From e283c1a2675d1336aba0e8141ed94efa3ac68b04 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Thu, 23 Nov 2017 21:26:39 +0300 Subject: [PATCH] Linked to prefetch_related_objects func in DB optimization docs. --- docs/topics/db/optimization.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/topics/db/optimization.txt b/docs/topics/db/optimization.txt index ea29108c0cf..96ff65fd7e8 100644 --- a/docs/topics/db/optimization.txt +++ b/docs/topics/db/optimization.txt @@ -195,12 +195,13 @@ Understand :meth:`~django.db.models.query.QuerySet.select_related` and :meth:`~django.db.models.query.QuerySet.prefetch_related` thoroughly, and use them: -* in view code, - -* and in :doc:`managers and default managers ` where +* in :doc:`managers and default managers ` where appropriate. Be aware when your manager is and is not used; sometimes this is tricky so don't make assumptions. +* in view code or other layers, possibly making use of + :func:`~django.db.models.prefetch_related_objects` where needed. + Don't retrieve things you don't need ====================================