[Django] #25236: Remove ifequal from the template language

13 views
Skip to first unread message

Django

unread,
Aug 6, 2015, 11:53:15 AM8/6/15
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
--------------------------------------+--------------------
Reporter: pydanny | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Template system | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
No modern project uses ifequal. No one recommends it. I argue it is taking
up valuable bytes in the project. Let's remove it.

--
Ticket URL: <https://code.djangoproject.com/ticket/25236>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 6, 2015, 12:03:53 PM8/6/15
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
-------------------------------------+-------------------------------------
Reporter: pydanny | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Seems like a good idea, although I am afraid we may get more pushback
regarding "needless deprecations" from old, large Django projects that use
it. A middle ground could be to remove it from the documentation. Would
you like to write to the DevelopersMailingList to see what others think?

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:1>

Django

unread,
Aug 6, 2015, 12:18:04 PM8/6/15
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
--------------------------------------+------------------------------------

Reporter: pydanny | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by mjtamlyn):

* stage: Unreviewed => Accepted


Comment:

The smart if tag which made ifequal redundant was introduced in Django
1.2. Really, ifequal should have been deprecated then. I agree this is a
good candidate for deprecation, and I'd rather take a bit of flak for
"needless" deprecations than keep tested (?) but undocumented code around
forever.

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:2>

Django

unread,
Aug 6, 2015, 12:30:48 PM8/6/15
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
--------------------------------------+------------------------------------

Reporter: pydanny | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by pydanny):

Submitted to the dev mailing list.

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:3>

Django

unread,
Aug 8, 2015, 7:50:55 AM8/8/15
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
--------------------------------------+------------------------------------

Reporter: pydanny | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"a3830f6d663aee9e91871002cbff7c57aee6d989" a3830f6]:
{{{
#!CommitTicketReference repository=""
revision="a3830f6d663aee9e91871002cbff7c57aee6d989"
Refs #25236 -- Removed ifequal/ifnotequal usage.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:4>

Django

unread,
Aug 8, 2015, 8:24:08 AM8/8/15
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
--------------------------------------+------------------------------------

Reporter: pydanny | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"787cc7aa843d5c0834f56b5f8ae03b86ce553c51" 787cc7a]:
{{{
#!CommitTicketReference repository=""
revision="787cc7aa843d5c0834f56b5f8ae03b86ce553c51"
Refs #25236 -- Discouraged use of ifequal/ifnotequal template tags.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:5>

Django

unread,
Aug 8, 2015, 8:30:38 AM8/8/15
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
-------------------------------------+-------------------------------------
Reporter: pydanny | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Someday/Maybe


Comment:

Moving to "Someday/Maybe" as we have multiple complaints on the
[https://groups.google.com/d/topic/django-
developers/J7vpMKSHk7U/discussion mailing list] that updating projects for
this removal will be too onerous to justify the cleanup.

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:6>

Django

unread,
Aug 8, 2015, 8:56:06 AM8/8/15
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
-------------------------------------+-------------------------------------
Reporter: pydanny | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"2112879305d0c78bdb7460e55f70591c89790e39" 21128793]:
{{{
#!CommitTicketReference repository=""
revision="2112879305d0c78bdb7460e55f70591c89790e39"
[1.8.x] Refs #25236 -- Discouraged use of ifequal/ifnotequal template
tags.

Backport of 787cc7aa843d5c0834f56b5f8ae03b86ce553c51 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:7>

Django

unread,
May 4, 2020, 12:10:28 AM5/4/20
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
-------------------------------------+-------------------------------------
Reporter: Daniel Greenfeld | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

[https://github.com/django/django/pull/12851 PR]. I think we should
refresh [https://groups.google.com/forum/#!topic/django-
developers/J7vpMKSHk7U/discussion discussion] on the mailing list.

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:8>

Django

unread,
May 4, 2020, 1:21:15 PM5/4/20
to django-...@googlegroups.com
#25236: Remove ifequal from the template language
-------------------------------------+-------------------------------------
Reporter: Daniel Greenfeld | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Jon Dufresne):

The following quick and dirty script will update a codebase to the newer
`{% if %}` syntax. This will update files in place, so please be sure to
backup your code first, preferably with SCM. You should examine the
results of the diff for correctness before accepting.

{{{
find $(find -name templates) -type f -exec perl -pi -e 's/{% *ifequal
+(.+?) +(.+?) *%}/{% if $1 == $2 %}/;' -e 's/{% *endifequal *%}/{% endif
%}/;' -e 's/{% *ifnotequal +(.+?) +(.+?) *%}/{% if $1 != $2 %}/;' -e 's/{%
*endifnotequal *%}/{% endif %}/;' {} \;
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:9>

Django

unread,
May 6, 2020, 3:34:58 AM5/6/20
to django-...@googlegroups.com
#25236: Remove ifequal from the template language.
-------------------------------------+-------------------------------------
Reporter: Daniel Greenfeld | Owner: Jon
Type: | Dufresne
Cleanup/optimization | Status: assigned

Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* owner: nobody => Jon Dufresne
* status: new => assigned
* has_patch: 0 => 1


Comment:

We didn't get any new complains on the mailing list, so it's time to
remove them.

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:10>

Django

unread,
May 11, 2020, 2:07:35 AM5/11/20
to django-...@googlegroups.com
#25236: Remove ifequal from the template language.
-------------------------------------+-------------------------------------
Reporter: Daniel Greenfeld | Owner: Jon
Type: | Dufresne
Cleanup/optimization | Status: assigned
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Someday/Maybe => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:11>

Django

unread,
May 11, 2020, 3:34:08 AM5/11/20
to django-...@googlegroups.com
#25236: Remove ifequal from the template language.
-------------------------------------+-------------------------------------
Reporter: Daniel Greenfeld | Owner: Jon
Type: | Dufresne
Cleanup/optimization | Status: closed

Component: Template system | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"72a170b4c3c4c2db8192bb1a6424bcc8eb533973" 72a170b]:
{{{
#!CommitTicketReference repository=""
revision="72a170b4c3c4c2db8192bb1a6424bcc8eb533973"
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.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:12>

Django

unread,
Jan 14, 2021, 2:12:20 PM1/14/21
to django-...@googlegroups.com
#25236: Remove ifequal from the template language.
-------------------------------------+-------------------------------------
Reporter: Daniel Greenfeld | Owner: Jon
Type: | Dufresne
Cleanup/optimization | Status: closed
Component: Template system | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"e7208f13c0448387e56c340eed46e1ed9ef9997e" e7208f1]:
{{{
#!CommitTicketReference repository=""
revision="e7208f13c0448387e56c340eed46e1ed9ef9997e"
Refs #25236 -- Removed {% ifequal %} and {% ifnotequal %} template tags
per deprecation timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25236#comment:13>

Reply all
Reply to author
Forward
0 new messages