From fff14736f1cc594f79ea0e2656b8375d837b7aca Mon Sep 17 00:00:00 2001 From: John Parton Date: Thu, 27 Jul 2023 16:38:12 -0500 Subject: Fixed #34331 -- Added QuerySet.aiterator() support for prefetch_related(). --- docs/ref/models/querysets.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 92cf3baaec..8a9733786a 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -2579,10 +2579,10 @@ evaluated will force it to evaluate again, repeating the query. long as ``chunk_size`` is given. Larger values will necessitate fewer queries to accomplish the prefetching at the cost of greater memory usage. -.. note:: +.. versionchanged:: 5.0 - ``aiterator()`` is *not* compatible with previous calls to - ``prefetch_related()``. + Support for ``aiterator()`` with previous calls to ``prefetch_related()`` + was added. On some databases (e.g. Oracle, `SQLite `_), the maximum number @@ -4073,6 +4073,9 @@ attribute: ------------------------------ .. function:: prefetch_related_objects(model_instances, *related_lookups) +.. function:: aprefetch_related_objects(model_instances, *related_lookups) + +*Asynchronous version*: ``aprefetch_related_objects()`` 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``; @@ -4091,6 +4094,10 @@ When using multiple databases with ``prefetch_related_objects``, the prefetch query will use the database associated with the model instance. This can be overridden by using a custom queryset in a related lookup. +.. versionchanged:: 5.0 + + ``aprefetch_related_objects()`` function was added. + ``FilteredRelation()`` objects ------------------------------ -- cgit v1.3