mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
- 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:
parent
99742d8d73
commit
3ae9117c46
8 changed files with 274 additions and 83 deletions
|
@ -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 %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue