diff options
| author | Craig Oldford <cj1982@gmail.com> | 2015-04-13 12:27:30 -0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-04-14 07:19:47 -0400 |
| commit | 75bc5bc634e90d5ccd2d7fc324df878dc5d4ce5d (patch) | |
| tree | 31e9c1157b5df93e1da9ecf5d3c9d7208d4868dc /docs | |
| parent | 6023312dde022d31d44373e8834431456095dc7c (diff) | |
Fixed #12199 -- Added the ability to use "as" with the firstof template tag.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 7 | ||||
| -rw-r--r-- | docs/releases/1.9.txt | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index af0da83354..f51e70dcac 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -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 diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index d89354ea6a..47c2bc98bc 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -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 ^^^^^^^^^^^^^^^^^^^^^^ |
