autocomplete: group after join, use findvalue
This commit is contained in:
parent
527330521b
commit
c85ec239a2
1 changed files with 1 additions and 1 deletions
|
@ -206,9 +206,9 @@ def autocomplete(data):
|
|||
qs = qs.filter(models.Find.findvalue.startswith(value))
|
||||
elif op == '$':
|
||||
qs = qs.filter(models.Find.findvalue.endswith(value))
|
||||
qs = qs.group_by(models.Find.value)
|
||||
if add_itemsort:
|
||||
qs = qs.join(models.Item).join(models.Sort)
|
||||
qs = qs.group_by(models.Find.findvalue)
|
||||
qs = qs.order_by(*order_by)
|
||||
response['items'] = [r.value for r in qs[data['range'][0]:data['range'][1]]]
|
||||
return response
|
||||
|
|
Loading…
Reference in a new issue