get_query to server side

This commit is contained in:
Saurabh
2013-07-10 17:35:14 +05:30
parent a29b69245e
commit ee85cfd476
13 changed files with 116 additions and 83 deletions

View File

@@ -96,8 +96,9 @@ def get_events(start, end, filters=None):
def get_project(doctype, txt, searchfield, start, page_len, filters):
from controllers.queries import get_match_cond
return webnotes.conn.sql(""" select name from `tabProject`
where %(key)s like "%(txt)s" %(mcond)s
order by name limit %(start)s, %(page_len)s
""" % {'key': searchfield, 'txt': "%%%s%%" % txt,
'mcond':get_match_cond(doctype, searchfield),
'start': start, 'page_len': page_len})
where %(key)s like "%(txt)s"
%(mcond)s
order by name
limit %(start)s, %(page_len)s """ % {'key': searchfield,
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield),
'start': start, 'page_len': page_len})