From e37294ce91bb8a67c79fd0671cd6ebfc7576da76 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 25 Jan 2011 20:44:36 +0530 Subject: [PATCH] autocomplete --- pandora/item/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index 0e77c5a..a140ec7 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -20,7 +20,6 @@ import models import utils import tasks - from archive.models import File from archive import extract @@ -267,12 +266,12 @@ def autocomplete(request): site_config = models.site_config() key = site_config['keys'][data['key']] - order_by = key.get('find', {}).get('autocompleteSortKey', False) + order_by = key.get('autocompleteSortKey', False) if order_by: order_by = '-sort__%s' % order_by else: order_by = '-items' - sort_type = key.get('sort', {}).get('type', 'string') + sort_type = key.get('sort', key.get('type', 'string')) if sort_type == 'title': qs = _parse_query({'query': data.get('query', {})}, request.user)['qs'] if data['value']: