mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #26118 -- Added 'is' operator to if template tag.
This commit is contained in:
parent
a08d2463d2
commit
c00ae7f58c
4 changed files with 25 additions and 1 deletions
|
@ -432,7 +432,7 @@ Use of actual parentheses in the :ttag:`if` tag is invalid syntax. If you need
|
|||
them to indicate precedence, you should use nested :ttag:`if` tags.
|
||||
|
||||
:ttag:`if` tags may also use the operators ``==``, ``!=``, ``<``, ``>``,
|
||||
``<=``, ``>=`` and ``in`` which work as follows:
|
||||
``<=``, ``>=``, ``in``, and ``is`` which work as follows:
|
||||
|
||||
``==`` operator
|
||||
^^^^^^^^^^^^^^^
|
||||
|
@ -524,6 +524,17 @@ you should use::
|
|||
|
||||
{% if a > b and b > c %}
|
||||
|
||||
``is`` operator
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
Object identity. Tests if two values are the same object. Example::
|
||||
|
||||
{% if value is None %}
|
||||
This will output if and only if value is None.
|
||||
{% endif %}
|
||||
|
||||
Filters
|
||||
~~~~~~~
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue