sort by index, should only be used with static lists

This commit is contained in:
j 2013-07-17 12:44:29 +00:00
parent 8fffc75354
commit 04d35b43db

View file

@ -46,8 +46,10 @@ def _order_query(qs, sort, prefix='sort__'):
operator = '' operator = ''
key = { key = {
'id': 'itemId', 'id': 'itemId',
'index': 'listitem__index'
}.get(e['key'], e['key']) }.get(e['key'], e['key'])
key = "%s%s" % (prefix, key) if key not in ('listitem__index', ):
key = "%s%s" % (prefix, key)
order = '%s%s' % (operator, key) order = '%s%s' % (operator, key)
order_by.append(order) order_by.append(order)
if order_by: if order_by: