mirror of
https://github.com/django/django.git
synced 2025-11-01 12:25:37 +00:00
Fixed #12199 -- Added the ability to use "as" with the firstof template tag.
This commit is contained in:
parent
6023312dde
commit
75bc5bc634
4 changed files with 31 additions and 4 deletions
|
|
@ -285,6 +285,13 @@ Or if only some variables should be escaped, you can use::
|
|||
|
||||
{% firstof var1 var2|safe var3 "<strong>fallback value</strong>"|safe %}
|
||||
|
||||
You can use the syntax ``{% firstof var1 var2 var3 as value %}`` to store the
|
||||
output inside a variable.
|
||||
|
||||
.. versionadded:: 1.9
|
||||
|
||||
The "as" syntax was added.
|
||||
|
||||
.. templatetag:: for
|
||||
|
||||
for
|
||||
|
|
|
|||
|
|
@ -208,6 +208,9 @@ Templates
|
|||
* A warning will now be logged for missing context variables. These messages
|
||||
will be logged to the :ref:`django.template <django-template-logger>` logger.
|
||||
|
||||
* The :ttag:`firstof` template tag supports storing the output in a variable
|
||||
using 'as'.
|
||||
|
||||
Requests and Responses
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue