1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #36426 -- Added support for further iterables in prefetch_related_objects().

Thanks Sarah Boyce for the review.
This commit is contained in:
blingblin-g
2025-07-31 00:03:27 +09:00
committed by Jacob Walls
parent e059bbec96
commit e08fa42fa6
3 changed files with 37 additions and 5 deletions

View File

@@ -4223,8 +4223,9 @@ Prefetches the given lookups on an iterable of model instances. This is useful
in code that receives a list of model instances as opposed to a ``QuerySet``;
for example, when fetching models from a cache or instantiating them manually.
Pass an iterable of model instances (must all be of the same class) and the
lookups or :class:`Prefetch` objects you want to prefetch for. For example:
Pass an iterable of model instances (must all be of the same class and able to
be iterated multiple times) and the lookups or :class:`Prefetch` objects you
want to prefetch for. For example:
.. code-block:: pycon