From 72a170b4c3c4c2db8192bb1a6424bcc8eb533973 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 2 May 2020 18:04:51 -0700 Subject: 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. --- docs/internals/deprecation.txt | 2 ++ docs/ref/templates/builtins.txt | 3 ++- docs/releases/3.1.txt | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'docs') 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 ` 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 %}`` 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' + ` option in + :setting:`OPTIONS `. + .. _removed-features-3.1: Features removed in 3.1 -- cgit v1.3