This commit is contained in:
j 2019-01-17 15:57:55 +05:30
parent c3cdc4ccd9
commit 507b6fed3e

View file

@ -16,8 +16,8 @@ logger = logging.getLogger(__name__)
def parse(data): def parse(data):
query = {} query = {}
query['range'] = [0, 100] query['range'] = [0, 100]
if not 'group' in data: if 'group' not in data:
query['sort'] = [{'key':'title', 'operator':'+'}] query['sort'] = [{'key': 'title', 'operator': '+'}]
for key in ('keys', 'group', 'list', 'range', 'sort', 'query'): for key in ('keys', 'group', 'list', 'range', 'sort', 'query'):
if key in data: if key in data:
query[key] = data[key] query[key] = data[key]
@ -26,7 +26,7 @@ def parse(data):
query['range'] = [0, 0] query['range'] = [0, 0]
#print data #print data
query['qs'] = models.Item.find(data) query['qs'] = models.Item.find(data)
if not 'group' in query: if 'group' not in query:
query['qs'] = order(query['qs'], query['sort']) query['qs'] = order(query['qs'], query['sort'])
return query return query