mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-10 08:14:53 +00:00
Put prefetch related back in database backend
This commit is contained in:
parent
d25b6fb6c0
commit
3c1883bca0
1 changed files with 4 additions and 2 deletions
|
|
@ -66,7 +66,9 @@ class DBSearch(BaseSearch):
|
|||
# Distinct
|
||||
query = query.distinct()
|
||||
|
||||
# Give deprecation warning if prefetch_related was used
|
||||
warnings.warn("prefetch_related on search queries is no longer implemented. ", DeprecationWarning)
|
||||
# Prefetch related
|
||||
if prefetch_related:
|
||||
for prefetch in prefetch_related:
|
||||
query = query.prefetch_related(prefetch)
|
||||
|
||||
return query
|
||||
Loading…
Reference in a new issue