Changeset 4831
- Timestamp:
- 03/27/07 12:30:57 (1 year ago)
- Files:
-
- django/trunk/docs/templates.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/templates.txt
r4830 r4831 878 878 **New in Django development version** 879 879 880 Useful for caching a method which will be used more than once. 880 Caches a complex variable under a simpler name. This is useful when accessing 881 an "expensive" method (e.g. one that hits the database) multiple times. 881 882 882 883 For example:: 883 884 884 {% with person.some_sql_methodas total %}885 {{ total }} person object{{ total|pluralize }}885 {% with business.employees.count as total %} 886 {{ total }} employee{{ total|pluralize }} 886 887 {% endwith %} 887 888 888 889 The populated variable (in the example above, ``total``) is only available 889 inside of ``{% with %}`` block.890 inside of the ``{% with %}`` block. 890 891 891 892 Built-in filter reference
