Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Cleaned up the docs from [4830] a bit.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 45f9217cbd480725b0ce9d4028ee4fab7af21f11 1 parent d6fd9fb
@jacobian jacobian authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 docs/templates.txt
9 docs/templates.txt
@@ -877,16 +877,17 @@ with
**New in Django development version**
-Useful for caching a method which will be used more than once.
+Caches a complex variable under a simpler name. This is useful when accessing
+an "expensive" method (e.g. one that hits the database) multiple times.
For example::
- {% with person.some_sql_method as total %}
- {{ total }} person object{{ total|pluralize }}
+ {% with business.employees.count as total %}
+ {{ total }} employee{{ total|pluralize }}
{% endwith %}
The populated variable (in the example above, ``total``) is only available
-inside of ``{% with %}`` block.
+inside of the ``{% with %}`` block.
Built-in filter reference

0 comments on commit 45f9217

Please sign in to comment.
Something went wrong with that request. Please try again.