diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2017-11-23 21:26:39 +0300 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2017-11-23 21:36:38 +0300 |
| commit | a09e974688e283019df32c35c6d7c217d1d16a8e (patch) | |
| tree | bf380e6ae2431c4d2c047ec0a7132d2dc7fecc3d /docs | |
| parent | be45c90ce30fcf3262b8c739c04163f9ad61f46a (diff) | |
[1.11.x] Linked to prefetch_related_objects func in DB optimization docs.
Backport of e283c1a from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/db/optimization.txt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/topics/db/optimization.txt b/docs/topics/db/optimization.txt index ea29108c0c..96ff65fd7e 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 </topics/db/managers>` where +* in :doc:`managers and default managers </topics/db/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 ==================================== |
