url controller updates, refactoring
This commit is contained in:
parent
4a8954332a
commit
1d894fc934
18 changed files with 287 additions and 427 deletions
|
|
@ -13,7 +13,9 @@ from item import utils
|
|||
from item.models import Item
|
||||
|
||||
def get_list_or_404_json(id):
|
||||
username, listname = id.split(':')
|
||||
id = id.split(':')
|
||||
username = id[0]
|
||||
listname = ":".join(id[1:])
|
||||
return get_object_or_404_json(models.List, user__username=username, name=listname)
|
||||
|
||||
def _order_query(qs, sort):
|
||||
|
|
@ -94,7 +96,7 @@ def findLists(request):
|
|||
else:
|
||||
qs = _order_query(query['qs'], query['sort'])
|
||||
|
||||
#range
|
||||
qs = qs.distinct()
|
||||
response = json_response()
|
||||
if 'keys' in data:
|
||||
qs = qs[query['range'][0]:query['range'][1]]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue