- The include tag now has a 'with' option to include to provide extra context
  vairables to the included template.

- The include tag now has an 'only' option to exclude the current context
  when rendering the included template.

- The with tag now accepts multiple variable assignments.

- The with, include and blocktrans tags now use a new keyword argument format
  for variable assignments (e.g. `{% with foo=1 bar=2 %}`).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Chris Beaven 2010-12-18 02:50:26 +00:00
parent 99742d8d73
commit 3ae9117c46
8 changed files with 274 additions and 83 deletions

View file

@ -206,7 +206,7 @@ many-to-many relation to User, the following template code is optimal:
.. code-block:: html+django
{% if display_inbox %}
{% with user.emails.all as emails %}
{% with emails=user.emails.all %}
{% if emails %}
<p>You have {{ emails|length }} email(s)</p>
{% for email in emails %}