From b1e93e506266c8cc00142081a21aaac892c4d759 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 8 Nov 2011 01:23:12 +0100 Subject: [PATCH] dont return same title twice in autocomplete --- pandora/item/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index a845832c..84c2953a 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -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']: