diff options
| author | Alasdair Nicol <alasdair@thenicols.net> | 2016-04-09 16:25:00 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-09 13:01:15 -0400 |
| commit | c16b9dd8e0ae757616e9accbaffecc521191ee98 (patch) | |
| tree | 691989f2102021cbbbad9fb27b3a28e10fc602e3 /docs | |
| parent | c10db4bd1b069739687b99d6b32b946634237431 (diff) | |
Fixed #26479 -- Added 'is not' operator to the if tag.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 15 | ||||
| -rw-r--r-- | docs/releases/1.10.txt | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 37abc62608..e11646f6bb 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -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 ~~~~~~~ diff --git a/docs/releases/1.10.txt b/docs/releases/1.10.txt index adae2524da..2002905b2d 100644 --- a/docs/releases/1.10.txt +++ b/docs/releases/1.10.txt @@ -409,7 +409,7 @@ Templates :class:`~django.template.backends.django.DjangoTemplates` backend and the :class:`~django.template.Engine` class. -* Added the ``is`` comparison operator to the :ttag:`if` tag. +* Added the ``is`` and ``is not`` comparison operators to the :ttag:`if` tag. * Allowed :tfilter:`dictsort` to order a list of lists by an element at a specified index. |
