mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #18702 -- Removed chunked reads from QuerySet iteration
This commit is contained in:
@@ -524,6 +524,25 @@ non-standard behavior has been preserved but moved to the model form field layer
|
||||
and occurs only when the associated widget is
|
||||
:class:`~django.forms.SelectMultiple` or a subclass.
|
||||
|
||||
QuerySet iteration
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ``QuerySet`` iteration was changed to immediately convert all fetched
|
||||
rows to ``Model`` objects. In Django 1.5 and earlier the fetched rows were
|
||||
converted to ``Model`` objects in chunks of 100.
|
||||
|
||||
Existing code will work, but the amount of rows converted to objects
|
||||
might change in certain use cases. Such usages include partially looping
|
||||
over a queryset or any usage which ends up doing ``__bool__`` or
|
||||
``__contains__``.
|
||||
|
||||
Notably most database backends did fetch all the rows in one go already in
|
||||
1.5.
|
||||
|
||||
It is still possible to convert the fetched rows to ``Model`` objects
|
||||
lazily by using the :meth:`~django.db.models.query.QuerySet.iterator()`
|
||||
method.
|
||||
|
||||
Miscellaneous
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user