kopia lustrzana https://github.com/wagtail/wagtail
Merge branch 'page-chooser-wagtailsearch' of https://github.com/kaedroho/wagtail into kaedroho-page-chooser-wagtailsearch
commit
b0524c94cf
|
@ -118,7 +118,7 @@ def search(request, parent_page_id=None):
|
|||
if search_form.is_valid() and search_form.cleaned_data['q']:
|
||||
pages = desired_class.objects.exclude(
|
||||
depth=1 # never include root
|
||||
).filter(title__icontains=search_form.cleaned_data['q'])[:10]
|
||||
).search(search_form.cleaned_data['q'], fields=['title'])[:10]
|
||||
else:
|
||||
pages = desired_class.objects.none()
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue