diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-05-02 18:04:51 -0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-05-11 09:07:33 +0200 |
| commit | 72a170b4c3c4c2db8192bb1a6424bcc8eb533973 (patch) | |
| tree | ba027dc00dc31cd0e2e8869e45eed35162bf1e98 /docs | |
| parent | d8cb8fdf40b92961a62effbc9231583901e258b5 (diff) | |
Fixed #25236 -- Deprecated {% ifequal %} and {% ifnotequal %} template tags.
The {% if %} tag provides all features of these tags.
Since Django 1.2 (May 17, 2010), the docs have hinted that
{% ifequal %} and {% ifnotequal %} will be deprecated in a future
Django version. Time to make it official.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 2 | ||||
| -rw-r--r-- | docs/ref/templates/builtins.txt | 3 | ||||
| -rw-r--r-- | docs/releases/3.1.txt | 7 |
3 files changed, 11 insertions, 1 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 183ce23408..074345ef40 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -90,6 +90,8 @@ details on these changes. ``django.contrib.postgres.fields.jsonb.KeyTransform``, and ``django.contrib.postgres.fields.jsonb.KeyTextTransform`` will be removed. +* The ``{% ifequal %}`` and ``{% ifnotequal %}`` template tags will be removed. + See the :ref:`Django 3.1 release notes <deprecated-features-3.1>` for more details on these changes. diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index cdb214c830..a8e8ad98f8 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -611,10 +611,11 @@ you should use:: ``ifequal`` and ``ifnotequal`` ------------------------------ +.. deprecated:: 3.1 + ``{% 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 diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt index 120a326628..35e46e5650 100644 --- a/docs/releases/3.1.txt +++ b/docs/releases/3.1.txt @@ -812,6 +812,13 @@ Miscellaneous * ``django.conf.urls.url()`` alias of :func:`django.urls.re_path` is deprecated. +* The ``{% ifequal %}`` and ``{% ifnotequal %}`` template tags are deprecated + in favor of :ttag:`{% if %}<if>`. ``{% if %}`` covers all use cases, but if + you need to continue using these tags, they can be extracted from Django to a + module and included as a built-in tag in the :class:`'builtins' + <django.template.backends.django.DjangoTemplates>` option in + :setting:`OPTIONS <TEMPLATES-OPTIONS>`. + .. _removed-features-3.1: Features removed in 3.1 |
