Use ModelIterable as the base class for SpecificIterable

We don't really need its __iter__ implementation, but Django added a
check in
e4a2e22ddb
that requires ModelIterable to be used when using in_bulk() with
values() or values_list().
pull/12289/head
Sage Abdullah 2024-09-02 17:21:18 +01:00 zatwierdzone przez Matt Westcott
rodzic 74681487e0
commit d6d0d4df5a
1 zmienionych plików z 2 dodań i 2 usunięć
wagtail

Wyświetl plik

@ -9,7 +9,7 @@ from django.contrib.contenttypes.models import ContentType
from django.db.models import CharField, Prefetch, Q
from django.db.models.expressions import Exists, OuterRef
from django.db.models.functions import Cast, Length, Substr
from django.db.models.query import BaseIterable, ModelIterable
from django.db.models.query import ModelIterable
from treebeard.mp_tree import MP_NodeQuerySet
from wagtail.models.i18n import Locale
@ -521,7 +521,7 @@ class PageQuerySet(SearchableQuerySetMixin, SpecificQuerySetMixin, TreeQuerySet)
)
class SpecificIterable(BaseIterable):
class SpecificIterable(ModelIterable):
def __iter__(self):
"""
Identify and return all specific items in a queryset, and return them