mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #35159 -- Fixed dumpdata crash when base querysets use prefetch_related().
Regression in1391356276following deprecation inedbf930287. Thanks Andrea F for the report.
This commit is contained in:
@@ -219,7 +219,10 @@ class Command(BaseCommand):
|
||||
if count_only:
|
||||
yield queryset.order_by().count()
|
||||
else:
|
||||
yield from queryset.iterator()
|
||||
chunk_size = (
|
||||
2000 if queryset._prefetch_related_lookups else None
|
||||
)
|
||||
yield from queryset.iterator(chunk_size=chunk_size)
|
||||
|
||||
try:
|
||||
self.stdout.ending = None
|
||||
|
||||
Reference in New Issue
Block a user