mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #35238 -- Fixed database serialization crash when base managers use prefetch_related().
Regression in 1391356276
following deprecation in eedbf930287cb72e9afab1f7208c24b1146b0c4ec.
This commit is contained in:
committed by
Mariusz Felisiak
parent
eb2d49b734
commit
a084c5d35a
@@ -135,7 +135,10 @@ class BaseDatabaseCreation:
|
||||
queryset = model._base_manager.using(
|
||||
self.connection.alias,
|
||||
).order_by(model._meta.pk.name)
|
||||
yield from queryset.iterator()
|
||||
chunk_size = (
|
||||
2000 if queryset._prefetch_related_lookups else None
|
||||
)
|
||||
yield from queryset.iterator(chunk_size=chunk_size)
|
||||
|
||||
# Serialize to a string
|
||||
out = StringIO()
|
||||
|
||||
Reference in New Issue
Block a user