autocomplete also needs nulls_last
This commit is contained in:
parent
9aa0c7bec7
commit
f7c202ce58
1 changed files with 1 additions and 1 deletions
|
@ -281,7 +281,7 @@ def autocomplete(request):
|
|||
qs = qs.filter(find__key=data['key'], find__value__istartswith=data['value'])
|
||||
elif op == '$':
|
||||
qs = qs.filter(find__key=data['key'], find__value__iendswith=data['value'])
|
||||
qs = qs.order_by(order_by)
|
||||
qs = qs.order_by(order_by, nulls_last=True)
|
||||
qs = qs[data['range'][0]:data['range'][1]]
|
||||
response = json_response({})
|
||||
response['data']['items'] = [i.get(data['key']) for i in qs]
|
||||
|
|
Loading…
Reference in a new issue