Return 20 results instead of default 10 for lookup tools

This commit is contained in:
Rob Hudson 2012-07-17 09:29:02 -07:00
Родитель a1f849ae95
Коммит 5498c6b05d
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -163,7 +163,7 @@ def user_search(request):
qs = UserProfile.objects.filter(pk=q).values(*fields) qs = UserProfile.objects.filter(pk=q).values(*fields)
else: else:
qs = (UserProfile.search().query(or_=_expand_query(q, fields)) qs = (UserProfile.search().query(or_=_expand_query(q, fields))
.values_dict(*fields)) .values_dict(*fields))[:20]
for user in qs: for user in qs:
user['url'] = reverse('lookup.user_summary', args=[user['id']]) user['url'] = reverse('lookup.user_summary', args=[user['id']])
user['name'] = user['username'] user['name'] = user['username']
@ -190,7 +190,7 @@ def app_search(request):
if not qs.count(): if not qs.count():
qs = (Addon.search().query(type=addon_type, qs = (Addon.search().query(type=addon_type,
or_=_expand_query(q, fields)) or_=_expand_query(q, fields))
.values_dict(*fields)) .values_dict(*fields))[:20]
for app in qs: for app in qs:
app['url'] = reverse('lookup.app_summary', args=[app['id']]) app['url'] = reverse('lookup.app_summary', args=[app['id']])
# ES returns a list of localized names but database queries do not. # ES returns a list of localized names but database queries do not.