diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2007-03-27 17:25:56 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2007-03-27 17:25:56 +0000 |
| commit | d6fd9fb22bdbc6939fbe97c6e0571b8002d014c6 (patch) | |
| tree | eef5c47d38ed97cbebefc1b1f92a3aa7f0d41b30 /docs | |
| parent | 750ea554c12b34f7b68653488f345f4066191e08 (diff) | |
Fixed #3826: added a {% with %}. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4830 bcc190cf-cafb-0310-a4f2-bffc1f526a37
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 ------------------------- |
