kopia lustrzana https://github.com/wagtail/wagtail
Use Page subclass get_admin_display_title() in admin search views.
The template changes force the most specific ``get_admin_display_title`` method to be used across all page explorer lists and page choosers in the admin. The view changes should reduce the performance hit in the case of the search views.pull/3794/merge
rodzic
11bf9b0e28
commit
4063573f9c
|
@ -161,6 +161,7 @@ def search(request, parent_page_id=None):
|
|||
depth=1 # never include root
|
||||
)
|
||||
pages = filter_page_type(pages, desired_classes)
|
||||
pages = pages.specific()
|
||||
pages = pages.search(search_form.cleaned_data['q'], fields=['title'])
|
||||
else:
|
||||
pages = pages.none()
|
||||
|
|
|
@ -874,7 +874,7 @@ def search(request):
|
|||
if form.is_valid():
|
||||
q = form.cleaned_data['q']
|
||||
|
||||
pages = Page.objects.all().prefetch_related('content_type').search(q)
|
||||
pages = Page.objects.all().prefetch_related('content_type').specific().search(q)
|
||||
paginator, pages = paginate(request, pages)
|
||||
else:
|
||||
form = SearchForm()
|
||||
|
|
Ładowanie…
Reference in New Issue