diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/templates.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/templates.txt b/docs/templates.txt index db748ae432..37fd1cdea4 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -872,6 +872,22 @@ Above, if ``this_value`` is 175 and ``max_value`` is 200, the the image in the above example will be 88 pixels wide (because 175/200 = .875; .875 * 100 = 87.5 which is rounded up to 88). +with +~~~~ + +**New in Django development version** + +Useful for caching a method which will be used more than once. + +For example:: + + {% with person.some_sql_method as total %} + {{ total }} person object{{ total|pluralize }} + {% endwith %} + +The populated variable (in the example above, ``total``) is only available +inside of ``{% with %}`` block. + Built-in filter reference ------------------------- |
