diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2010-12-31 15:48:51 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2010-12-31 15:48:51 +0000 |
| commit | fa4ac6f80ca0417b04106626c854f09a6f15879d (patch) | |
| tree | 58d9a3aae3f1a25104aa4a7f41220e78418b1bda /docs | |
| parent | 2d854539c327b3630265bec10263ae61ce81d202 (diff) | |
[1.2.X] Some small fixes to DB optimization docs.
Backport of [15122] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15123 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/db/optimization.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/topics/db/optimization.txt b/docs/topics/db/optimization.txt index 7d51052a77..865e64fc28 100644 --- a/docs/topics/db/optimization.txt +++ b/docs/topics/db/optimization.txt @@ -191,7 +191,7 @@ Don't overuse ``count()`` and ``exists()`` If you are going to need other data from the QuerySet, just evaluate it. -For example, assuming an Email class that has a ``body`` attribute and a +For example, assuming an Email model that has a ``body`` attribute and a many-to-many relation to User, the following template code is optimal: .. code-block:: html+django @@ -212,7 +212,8 @@ many-to-many relation to User, the following template code is optimal: It is optimal because: - 1. Since QuerySets are lazy, this does no database if 'display_inbox' is False. + 1. Since QuerySets are lazy, this does no database queries if 'display_inbox' + is False. #. Use of ``with`` means that we store ``user.emails.all`` in a variable for later use, allowing its cache to be re-used. |
