feat: Add a default filter

This commit is contained in:
Kyle Fuller
2016-11-27 18:27:30 +00:00
parent 3293d8a526
commit dfd57e9571
5 changed files with 34 additions and 0 deletions

View File

@@ -120,3 +120,13 @@ For example, `Stencil` to `stencil`.
.. code-block:: html+django
{{ "Stencil"|lowercase }}
``default``
~~~~~~~~~~~
If a variable not present in the context, use given default. Otherwise, use the
value of the variable. For example:
.. code-block:: html+django
Hello {{ name|default:"World" }}