From 600d7ec9749a1c87d00dd70619cded686da267c6 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 11 Nov 2011 12:39:05 +0000 Subject: [PATCH] fix default autocomplete operator --- pandora/item/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index f03dfbcf..eb22460f 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -302,7 +302,7 @@ def autocomplete(request): data = json.loads(request.POST['data']) if not 'range' in data: data['range'] = [0, 10] - op = data.get('operator', '==') + op = data.get('operator', '=') key = settings.CONFIG['keys'][data['key']] order_by = key.get('autocompleteSortKey', False) @@ -314,7 +314,7 @@ def autocomplete(request): if sort_type == 'title': qs = parse_query({'query': data.get('query', {})}, request.user)['qs'] if data['value']: - if op == '': + if op == '=': qs = qs.filter(find__key=data['key'], find__value__icontains=data['value']) elif op == '==': qs = qs.filter(find__key=data['key'], find__value__iexact=data['value'])