diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-08-08 14:52:21 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-08 15:02:31 +0200 |
| commit | 576ec12f8e7024679202b6213b8664ccd8b451b7 (patch) | |
| tree | d843909b73b11031a2eb105c35f1ad3a2c3fab53 /docs | |
| parent | 12cda89ffe6a03031a321d61ff8b91f9978e4b2e (diff) | |
[py3] Replaced __nonzero__ by __bool__
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/db/optimization.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/topics/db/optimization.txt b/docs/topics/db/optimization.txt index 573e1fd0aa..772792d39d 100644 --- a/docs/topics/db/optimization.txt +++ b/docs/topics/db/optimization.txt @@ -230,7 +230,7 @@ It is optimal because: #. 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, +#. The line ``{% if emails %}`` causes ``QuerySet.__bool__()`` to be called, which causes the ``user.emails.all()`` query to be run on the database, and at the least the first line to be turned into an ORM object. If there aren't any results, it will return False, otherwise True. |
