From 6dc9b04018032dccbb5ad8347f7ddf4341316166 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 14 Apr 2025 15:12:28 +0100 Subject: Refs #28586 -- Copied fetch modes to related objects. This change ensures that behavior and performance remain consistent when traversing relationships. --- docs/topics/db/fetch-modes.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs') diff --git a/docs/topics/db/fetch-modes.txt b/docs/topics/db/fetch-modes.txt index e76bb28a59..da7a07a0d4 100644 --- a/docs/topics/db/fetch-modes.txt +++ b/docs/topics/db/fetch-modes.txt @@ -29,6 +29,11 @@ Fetch modes apply to: * Fields deferred with :meth:`.QuerySet.defer` or :meth:`.QuerySet.only` * :ref:`generic-relations` +Django copies the fetch mode of an instance to any related objects it fetches, +so the mode applies to a whole tree of relationships, not just the top-level +model in the initial ``QuerySet``. This copying is also done in related +managers, even though fetch modes don't affect such managers' queries. + Available modes =============== -- cgit v1.3