1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #32511 -- Corrected handling prefetched nested reverse relationships.

When prefetching a set of child objects related to a set of parent
objects, we usually want to populate the relationship back from the
child to the parent to avoid a query when accessing that relationship
attribute. However, there's an edge case where the child queryset
itself specifies a prefetch back to the parent. In that case, we want
to use the prefetched relationship rather than populating the reverse
relationship from the parent.
This commit is contained in:
Jamie Matthews
2022-01-04 11:10:49 +00:00
committed by Mariusz Felisiak
parent 973fa56652
commit f5233dce30
3 changed files with 30 additions and 2 deletions

View File

@@ -423,6 +423,7 @@ answer newbie questions, and generally made Django that much better:
James Timmins <jameshtimmins@gmail.com>
James Turk <dev@jamesturk.net>
James Wheare <django@sparemint.com>
Jamie Matthews <jamie@mtth.org>
Jannis Leidel <jannis@leidel.info>
Janos Guljas
Jan Pazdziora