dont return same title twice in autocomplete

This commit is contained in:
j 2011-11-08 01:23:12 +01:00
parent 6aec4ff1b1
commit b1e93e5062

View file

@ -324,7 +324,7 @@ def autocomplete(request):
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]
response['data']['items'] = list(set([i.get(data['key']) for i in qs]))
else:
qs = models.Facet.objects.filter(key=data['key'])
if data['value']: