diff options
| author | Julien Phalip <jphalip@gmail.com> | 2011-10-03 08:06:01 +0000 |
|---|---|---|
| committer | Julien Phalip <jphalip@gmail.com> | 2011-10-03 08:06:01 +0000 |
| commit | c2b9f6496e59c9268fb265ea80df8c8d7ec88034 (patch) | |
| tree | 94e8c615e5ee9294ca5f5acc1aebcb0935b11bd2 /docs/topics/db | |
| parent | 0d9b6a5bc43c06716212bd3f847460ce985381aa (diff) | |
Added some sphinx cross-reference links to the built-in template tags and filters in multiple areas of the documentation. Also fixed a few minor inconsistencies and did a little PEP8 cleanup while I was at it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics/db')
| -rw-r--r-- | docs/topics/db/optimization.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/topics/db/optimization.txt b/docs/topics/db/optimization.txt index 3982ebd4f5..63aa11735b 100644 --- a/docs/topics/db/optimization.txt +++ b/docs/topics/db/optimization.txt @@ -225,8 +225,8 @@ It is optimal because: 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. + #. Use of :ttag:`with` means that we store ``user.emails.all`` in a variable + for later use, allowing its cache to be re-used. #. The line ``{% if emails %}`` causes ``QuerySet.__nonzero__()`` to be called, which causes the ``user.emails.all()`` query to be run on the database, and @@ -236,10 +236,10 @@ It is optimal because: #. The use of ``{{ emails|length }}`` calls ``QuerySet.__len__()``, filling out the rest of the cache without doing another query. - #. The ``for`` loop iterates over the already filled cache. + #. The :ttag:`for` loop iterates over the already filled cache. In total, this code does either one or zero database queries. The only -deliberate optimization performed is the use of the ``with`` tag. Using +deliberate optimization performed is the use of the :ttag:`with` tag. Using ``QuerySet.exists()`` or ``QuerySet.count()`` at any point would cause additional queries. |
