diff options
| author | Tim Graham <timograham@gmail.com> | 2015-08-08 08:12:53 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-08-08 08:23:33 -0400 |
| commit | 787cc7aa843d5c0834f56b5f8ae03b86ce553c51 (patch) | |
| tree | 245ce6683fa0240af2dd780ef7d060bd07c41299 /docs | |
| parent | 7080cef7bf12c7985d6c81822296e70d13553ef4 (diff) | |
Refs #25236 -- Discouraged use of ifequal/ifnotequal template tags.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 43 | ||||
| -rw-r--r-- | docs/spelling_wordlist | 2 |
2 files changed, 8 insertions, 37 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index a85bcf200e..1f5c5920c1 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -568,6 +568,14 @@ If you need different precedence, you will need to use nested :ttag:`if` tags. Sometimes that is better for clarity anyway, for the sake of those who do not know the precedence rules. +``ifequal`` and ``ifnotequal`` +"""""""""""""""""""""""""""""" + +``{% ifequal a b %} ... {% endifequal %}`` is an obsolete way to write +``{% if a == b %} ... {% endif %}``. Likewise, ``{% ifnotequal a b %} ... +{% endifnotequal %}`` is superseded by ``{% if a != b %} ... {% endif %}``. +The ``ifequal`` and ``ifnotequal`` tags will be deprecated in a future release. + .. templatetag:: ifchanged ifchanged @@ -613,41 +621,6 @@ will be displayed if the value has not changed:: ">{{ match }}</div> {% endfor %} -.. templatetag:: ifequal - -ifequal -^^^^^^^ - -Output the contents of the block if the two arguments equal each other. - -Example:: - - {% ifequal user.pk comment.user_id %} - ... - {% endifequal %} - -As in the :ttag:`if` tag, an ``{% else %}`` clause is optional. - -The arguments can be hard-coded strings, so the following is valid:: - - {% ifequal user.username "adrian" %} - ... - {% endifequal %} - -An alternative to the ``ifequal`` tag is to use the :ttag:`if` tag and the -``==`` operator. - -.. templatetag:: ifnotequal - -ifnotequal -^^^^^^^^^^ - -Just like :ttag:`ifequal`, except it tests that the two arguments are not -equal. - -An alternative to the ``ifnotequal`` tag is to use the :ttag:`if` tag and -the ``!=`` operator. - .. templatetag:: include include diff --git a/docs/spelling_wordlist b/docs/spelling_wordlist index 252503bbe0..fa3ba167ae 100644 --- a/docs/spelling_wordlist +++ b/docs/spelling_wordlist @@ -350,8 +350,6 @@ iendswith ies iexact ifchanged -ifequal -ifnotequal iframe inbox Incompliance |
