mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #26479 -- Added 'is not' operator to the if tag.
This commit is contained in:
parent
c10db4bd1b
commit
c16b9dd8e0
4 changed files with 33 additions and 4 deletions
|
@ -432,7 +432,8 @@ 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 ``==``, ``!=``, ``<``, ``>``,
|
||||
``<=``, ``>=``, ``in``, and ``is`` which work as follows:
|
||||
``<=``, ``>=``, ``in``, ``not in``, ``is``, and ``is not`` which work as
|
||||
follows:
|
||||
|
||||
``==`` operator
|
||||
^^^^^^^^^^^^^^^
|
||||
|
@ -526,6 +527,18 @@ Object identity. Tests if two values are the same object. Example::
|
|||
This will output if and only if value is None.
|
||||
{% endif %}
|
||||
|
||||
``is not`` operator
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 1.10
|
||||
|
||||
Tests if two values are not the same object. This is the negation of
|
||||
the ``is`` operator. Example::
|
||||
|
||||
{% if value is not None %}
|
||||
This will output if and only if value is not None.
|
||||
{% endif %}
|
||||
|
||||
Filters
|
||||
~~~~~~~
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue