Ticket #25236: Remove ifequal from the template language

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Ticket #25236: Remove ifequal from the template language

Daniel Greenfeld
No modern project uses ifequal. No one recommends it. I argue it is taking up valuable bytes in the project. Let's remove it.

Reference https://code.djangoproject.com/ticket/25236

In there you'll see Tim Graham mentions that older Django projects may push back on it, and suggests that a good medium ground would be to remove it from the documentation.

Any comments?

Regards,

Daniel Roy Greenfeld

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/add63617-a253-4571-a705-bf5773ed18ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Marc Tamlyn
I commented on the ticket - it's been redundant since Django 1.2 when the smart if was introduced. +1 to deprecating it.

On 6 August 2015 at 17:15, Daniel Greenfeld <[hidden email]> wrote:
No modern project uses ifequal. No one recommends it. I argue it is taking up valuable bytes in the project. Let's remove it.


In there you'll see Tim Graham mentions that older Django projects may push back on it, and suggests that a good medium ground would be to remove it from the documentation.

Any comments?

Regards,

Daniel Roy Greenfeld

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/add63617-a253-4571-a705-bf5773ed18ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMwjO1ECUQF7v6Mx33oOh-6JjY_12B8aw6sJ1Svv4-CXEuLGdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Tzu-ping Chung
In reply to this post by Daniel Greenfeld
Also +1 for its removal. And ifnotequal, too, since nobody seems to have mentioned this yet.

I would imagine a simple regex find-and-replace very much enough to fix most problems this causes. And if someone really want those tags, it is also pretty trivial to just pull them into a third-party app. One line in INSTALLED_APPS and a {% load %} tag fix everything.


Daniel Greenfeld於 2015年8月7日星期五 UTC+8上午12時15分49秒寫道:
No modern project uses ifequal. No one recommends it. I argue it is taking up valuable bytes in the project. Let's remove it.

Reference <a href="https://code.djangoproject.com/ticket/25236" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fcode.djangoproject.com%2Fticket%2F25236\46sa\75D\46sntz\0751\46usg\75AFQjCNEnjKVm_5aosql-4gDYelisKPdxcw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fcode.djangoproject.com%2Fticket%2F25236\46sa\75D\46sntz\0751\46usg\75AFQjCNEnjKVm_5aosql-4gDYelisKPdxcw&#39;;return true;">https://code.djangoproject.com/ticket/25236

In there you'll see Tim Graham mentions that older Django projects may push back on it, and suggests that a good medium ground would be to remove it from the documentation.

Any comments?

Regards,

Daniel Roy Greenfeld

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/e96ef778-9546-4137-a870-e4b833cdbef1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Karen Tracey-2
In reply to this post by Daniel Greenfeld
On Thu, Aug 6, 2015 at 12:15 PM, Daniel Greenfeld <[hidden email]> wrote:
No modern project uses ifequal. No one recommends it. I argue it is taking up valuable bytes in the project. Let's remove it.

I maintain (did not write) a project written last year that has ifequal and ifnotequal. Is it really necessary to make it harder to upgrade this project to a more recent Django?

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CACS9radErjkfJHC0wVvPJWK4HpzVQiAyj0s_2ykG57EAG1%2BqLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Marc Tamlyn
ifequal is technical debt in Django. It's a legacy way of doing things which we would not add now. Sure, we don't have to remove it, it isn't blocking us from doing anything else and it isn't broken, and it doesn't need much maintenance.

However, as with all technical debt, it has a cost. It's additional code, tests, documentation to maintain, low as the burden is. There is now "more than one way to do it" - when as a new developer who has learned {% if x == y %} I then stumbles across {% ifequal x y %}, which is better? Does it matter? Is one more efficient? They don't know that one is legacy code from days when {% if %} was more stupid.

We want to grow the Django community and make it easier to use Django. We also want to make sure that "There should be one-- and preferably only one --obvious way to do it". This is why we have done things like removing patterns(), why we rewrote transactions, why django.migrations is not South, and why removing features which could have been deprecated in 1.2 is important. Changes always result in work for upgrading existing sites, but this is a cost the community should bear to make progress.

The number of sites using ifequal is small (it's very old, and not recommended in any tutorial for many years). The number of future sites which should not be using it, and future users (and maintainers of old projects) who shouldn't have to worry about two ways to do the same thing is large. The upgrade path is easy - you can achieve it with sed.

Quoting the 1.2 release notes: "There’s really no reason to use {% ifequal %} or {% ifnotequal %} anymore, unless you’re the nostalgic type."

On 6 August 2015 at 21:07, Karen Tracey <[hidden email]> wrote:
On Thu, Aug 6, 2015 at 12:15 PM, Daniel Greenfeld <[hidden email]> wrote:
No modern project uses ifequal. No one recommends it. I argue it is taking up valuable bytes in the project. Let's remove it.

I maintain (did not write) a project written last year that has ifequal and ifnotequal. Is it really necessary to make it harder to upgrade this project to a more recent Django?

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CACS9radErjkfJHC0wVvPJWK4HpzVQiAyj0s_2ykG57EAG1%2BqLA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMwjO1EG9%2BOAWiW9iAT%3DnCFKD4_jDeBLVX2cJNXP6CUL9_uafA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Curtis Maloney
Let me open by saying I am in no way averse to the removal of these
two tags... and this reminds me I need to also re-work my "remove the
'x as y' argument syntax" patch again...

On 7 August 2015 at 07:08, Marc Tamlyn <[hidden email]> wrote:
> However, as with all technical debt, it has a cost. It's additional code,
> tests, documentation to maintain, low as the burden is. There is now "more
> than one way to do it" - when as a new developer who has learned {% if x ==
> y %} I then stumbles across {% ifequal x y %}, which is better? Does it
> matter? Is one more efficient?

As a small point, and I have met people for whom it was beneficial,
ifequal/ifnotequal _are_ more efficient than smart-if... it's a tiny
margin, but they are, and inside an inner loop, it can make quite a
difference.

I'm not advocating we keep them, just putting the info out there.

Personally, I'll just add another yak to my quiver of optimising if
... perhaps putting my AST skills to good use :)

--
C

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAG_XiSA0fp2GeQ1-rf2NtxW8gQ1GYJ52mwT%3D_1pZwhdWnZ-_vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Karen Tracey-2
In reply to this post by Marc Tamlyn

Believe me I understand what technical debt is. In my opinion the cost of this debt in Django is not sufficient to warrant the cost to users of Django to remove it. Find and fix (or figure out if it's necessary to fix) all templates (some of which may be coming from 3rd party packages)  used in a site is not that trivial of a task for a large site with many 3rd party dependencies. By contrast documenting why these two tags exist is pretty painless.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CACS9rafSuot0xati8HLOe2QEV7QpNny7d4bZDnVGzwsiAgDP7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Curtis Maloney
Given the [currently] low burden, I agree with a more gradual
deprecation... document against their use to help encourage people to
move away from them, then we're in a better position to more
painlessly remove them in the future.

--
Curtis

On 7 August 2015 at 11:43, Karen Tracey <[hidden email]> wrote:

> Believe me I understand what technical debt is. In my opinion the cost of
> this debt in Django is not sufficient to warrant the cost to users of Django
> to remove it. Find and fix (or figure out if it's necessary to fix) all
> templates (some of which may be coming from 3rd party packages)  used in a
> site is not that trivial of a task for a large site with many 3rd party
> dependencies. By contrast documenting why these two tags exist is pretty
> painless.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CACS9rafSuot0xati8HLOe2QEV7QpNny7d4bZDnVGzwsiAgDP7A%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAG_XiSCwn53hms4SBCR5bLyAf-Cwnqk1jgcOwmv-FNPSoR2R1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Josh Smeaton
Can we just push the ifequal type tags through regular deprecation? As mentioned, the cost of maintaining the tags is extremely low. Remove the ifequal tags from the docs, document their deprecation, and remove in Django 2.0.

On Friday, 7 August 2015 11:56:29 UTC+10, Curtis Maloney wrote:
Given the [currently] low burden, I agree with a more gradual
deprecation... document against their use to help encourage people to
move away from them, then we're in a better position to more
painlessly remove them in the future.

--
Curtis

On 7 August 2015 at 11:43, Karen Tracey <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="SUhhnOn_CQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">kmtr...@...> wrote:

> Believe me I understand what technical debt is. In my opinion the cost of
> this debt in Django is not sufficient to warrant the cost to users of Django
> to remove it. Find and fix (or figure out if it's necessary to fix) all
> templates (some of which may be coming from 3rd party packages)  used in a
> site is not that trivial of a task for a large site with many 3rd party
> dependencies. By contrast documenting why these two tags exist is pretty
> painless.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="SUhhnOn_CQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-develop...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="SUhhnOn_CQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-d...@googlegroups.com.
> Visit this group at <a href="http://groups.google.com/group/django-developers" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://groups.google.com/group/django-developers&#39;;return true;" onclick="this.href=&#39;http://groups.google.com/group/django-developers&#39;;return true;">http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> <a href="https://groups.google.com/d/msgid/django-developers/CACS9rafSuot0xati8HLOe2QEV7QpNny7d4bZDnVGzwsiAgDP7A%40mail.gmail.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-developers/CACS9rafSuot0xati8HLOe2QEV7QpNny7d4bZDnVGzwsiAgDP7A%40mail.gmail.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-developers/CACS9rafSuot0xati8HLOe2QEV7QpNny7d4bZDnVGzwsiAgDP7A%40mail.gmail.com&#39;;return true;">https://groups.google.com/d/msgid/django-developers/CACS9rafSuot0xati8HLOe2QEV7QpNny7d4bZDnVGzwsiAgDP7A%40mail.gmail.com.
>
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/c12b57b2-88fd-4f72-9f65-302645f19823%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Karen Tracey-2
We certainly weren't discussing removing without deprecating, were we? I'm saying removing isn't worth the hassle to users, period. My opinion from working on a fair number of inherited sites, plus sites where I don't get to choose who contributes code I'm responsible for maintaining. I've reported I have code I have to maintain written last year that uses these tags, it's not just ancient crufty old stuff. These tags don't cause a massive "brain stop" to figure out what "ifequal" might mean when encountering them in existing templates.They are not that bad. This wart isn't worth the pain to users to remove, in my opinion. Finding and fixing all templates used by a site is NOT trivial. Fixing url was worth it. This is not.


--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CACS9radxTh4mNtkQ%3Dfg5yUg_MF_EUu6Yqo%3DNGNqJg7e5vAwbwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Josh Smeaton
Fair enough, I don't necessarily disagree with you. Would removing the documentation for ifequal be OK? At least that would prevent new projects from using it or being confused about multiple ways to compare values.

On Friday, 7 August 2015 12:49:37 UTC+10, Karen Tracey wrote:
We certainly weren't discussing removing without deprecating, were we? I'm saying removing isn't worth the hassle to users, period. My opinion from working on a fair number of inherited sites, plus sites where I don't get to choose who contributes code I'm responsible for maintaining. I've reported I have code I have to maintain written last year that uses these tags, it's not just ancient crufty old stuff. These tags don't cause a massive "brain stop" to figure out what "ifequal" might mean when encountering them in existing templates.They are not that bad. This wart isn't worth the pain to users to remove, in my opinion. Finding and fixing all templates used by a site is NOT trivial. Fixing url was worth it. This is not.


--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/44ee5d1f-1071-4dd7-a1dd-fe798c0dc2de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Curtis Maloney
I'd probably go with updating the documentation to say they're legacy
tags, you're better off using {% if %} now, and warn they may be
removed in a later release.

This way (a) people are warned off it, and (b) we're confusing people
who find it and want to check what it does [even though it's quite
clear from the name]

--
Curtis


On 7 August 2015 at 13:05, Josh Smeaton <[hidden email]> wrote:

> Fair enough, I don't necessarily disagree with you. Would removing the
> documentation for ifequal be OK? At least that would prevent new projects
> from using it or being confused about multiple ways to compare values.
>
> On Friday, 7 August 2015 12:49:37 UTC+10, Karen Tracey wrote:
>>
>> We certainly weren't discussing removing without deprecating, were we? I'm
>> saying removing isn't worth the hassle to users, period. My opinion from
>> working on a fair number of inherited sites, plus sites where I don't get to
>> choose who contributes code I'm responsible for maintaining. I've reported I
>> have code I have to maintain written last year that uses these tags, it's
>> not just ancient crufty old stuff. These tags don't cause a massive "brain
>> stop" to figure out what "ifequal" might mean when encountering them in
>> existing templates.They are not that bad. This wart isn't worth the pain to
>> users to remove, in my opinion. Finding and fixing all templates used by a
>> site is NOT trivial. Fixing url was worth it. This is not.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/44ee5d1f-1071-4dd7-a1dd-fe798c0dc2de%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAG_XiSBPO35aTAemeP2%2BtFs2v-dacUHR3NiYoOFC8%3D4sYmgXhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Aymeric Augustin
> On 7 août 2015, at 05:43, Curtis Maloney <[hidden email]> wrote:
>
> I'd probably go with updating the documentation to say they're legacy
> tags, you're better off using {% if %} now, and warn they may be
> removed in a later release.

This is my inclination as well. Then we can revisit the topic in a few years :-)

--
Aymeric.




--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3E8B252E-B8A9-4B47-9FF8-A539E43DB933%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Tim Graham-2
Django 1.9 has the option to add templates tags to the builtins using the TEMPLATES setting, so it wouldn't be difficult to publish a third-party app with the legacy tags and document how to use it in legacy projects that have difficulty updating:

OPTIONS={
    'builtins': ['ifequal.tags'],
}

On Friday, August 7, 2015 at 3:06:42 AM UTC-4, Aymeric Augustin wrote:
> On 7 août 2015, at 05:43, Curtis Maloney <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="5J9OZdcQCgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">cur...@...> wrote:
>
> I'd probably go with updating the documentation to say they're legacy
> tags, you're better off using {% if %} now, and warn they may be
> removed in a later release.

This is my inclination as well. Then we can revisit the topic in a few years :-)

--
Aymeric.




--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/37cd1da2-6fa7-4a79-a8c4-a9292e063ef5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Tim Graham-2
I put together a pull request to see how much code we are talking about: https://github.com/django/django/pull/5114

It's 275 lines of code (mostly tests). I don't mind the outcome of the decision either way, but as it's been 5 years since the release of 1.2 and the "smart if" tag, I'm not sure delaying this a few more years would make a huge difference (that is to say, how about we make a "remove now or never" decision). We did a similar "undocument but don't remove" thing with the @permalink decorator.

On Friday, August 7, 2015 at 7:33:52 AM UTC-4, Tim Graham wrote:
Django 1.9 has the option to add templates tags to the builtins using the TEMPLATES setting, so it wouldn't be difficult to publish a third-party app with the legacy tags and document how to use it in legacy projects that have difficulty updating:

OPTIONS={
    'builtins': ['ifequal.tags'],
}

On Friday, August 7, 2015 at 3:06:42 AM UTC-4, Aymeric Augustin wrote:
> On 7 août 2015, at 05:43, Curtis Maloney <[hidden email]> wrote:
>
> I'd probably go with updating the documentation to say they're legacy
> tags, you're better off using {% if %} now, and warn they may be
> removed in a later release.

This is my inclination as well. Then we can revisit the topic in a few years :-)

--
Aymeric.




--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ca285211-7ccd-4a12-ba95-8277dd86cfbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Marc Tamlyn

I think Tim's suggestion of releasing the tag as a separate library which can be included in builtins answers Karen's concerns about updating 3rd party templates. I admit that is a case I had not considered.

Marc

On 7 Aug 2015 15:31, "Tim Graham" <[hidden email]> wrote:
I put together a pull request to see how much code we are talking about: https://github.com/django/django/pull/5114

It's 275 lines of code (mostly tests). I don't mind the outcome of the decision either way, but as it's been 5 years since the release of 1.2 and the "smart if" tag, I'm not sure delaying this a few more years would make a huge difference (that is to say, how about we make a "remove now or never" decision). We did a similar "undocument but don't remove" thing with the @permalink decorator.

On Friday, August 7, 2015 at 7:33:52 AM UTC-4, Tim Graham wrote:
Django 1.9 has the option to add templates tags to the builtins using the TEMPLATES setting, so it wouldn't be difficult to publish a third-party app with the legacy tags and document how to use it in legacy projects that have difficulty updating:

OPTIONS={
    'builtins': ['ifequal.tags'],
}

On Friday, August 7, 2015 at 3:06:42 AM UTC-4, Aymeric Augustin wrote:
> On 7 août 2015, at 05:43, Curtis Maloney <[hidden email]> wrote:
>
> I'd probably go with updating the documentation to say they're legacy
> tags, you're better off using {% if %} now, and warn they may be
> removed in a later release.

This is my inclination as well. Then we can revisit the topic in a few years :-)

--
Aymeric.




--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ca285211-7ccd-4a12-ba95-8277dd86cfbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMwjO1GTDHgcxzC5g5dT6Vt2OdoPpd9g2YGg3QH1Un_ZVjnWTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Russell Keith-Magee-4
In reply to this post by Aymeric Augustin

On Fri, Aug 7, 2015 at 3:06 PM, Aymeric Augustin <[hidden email]> wrote:
> On 7 août 2015, at 05:43, Curtis Maloney <[hidden email]> wrote:
>
> I'd probably go with updating the documentation to say they're legacy
> tags, you're better off using {% if %} now, and warn they may be
> removed in a later release.

This is my inclination as well. Then we can revisit the topic in a few years :-)

I agree. We shouldn't encourage new users to use the {% ifequal %} tag, but I don't see any benefit in removing something that is in use, and doesn't pose any particular maintenance burden or impediment to progress.

The only other suggestion I've got is to add a new "pre-deprecation" step to our deprecation process - a flag that lets us indicate that at some point, we intend to deprecate something, but we haven't decided when that will be. This would essentially be a "don't use this on new code, but there's no rush in replacing it". It could also be accompanied with a Warning so that existing uses could be found and replaced if someone was so inclined.

Yours,
Russ Magee %-)
 

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAJxq848UjiMPG%2B6WwzcHUBnZQbhFqXtKGWa8Uq3PxctHuy60xg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Collin Anderson-2
Hi All,

I really like the "don't use this on new code, but there's no rush in replacing it" category. I think that's really important to have that in a project that's this old. I think it would be great to minimize the amount required changes that need to be done.

Thanks,
Collin

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/2ddf20f1-af1a-47c1-b07c-669818846b53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Jon Dufresne
Hi,

I'd like to raise this topic for renewed discussion. I think it is time to begin deprecating the obsolete template tags. So +1 for removal.

I had all but forgotten about the {% ifequal %} template tag and then eventually stumbled across it doing unrelated work. Upon rediscovering it as a practical duplicate of {% if %}, I thought I'd help out Django by deprecating it for eventual removal so that we're back to "one -- and preferably only one -- obvious way to do it". I created the PR to begin the deprecation here: https://github.com/django/django/pull/12851

We're now coming up on 10 years since Django 1.2 was released with the smart if template tag. Projects and third party apps have had a generous extended time to update their code.

For projects that don't follow Django releases in detail, they may not be aware that the {% ifequal %} tag is obsolete and so have not had any motivation to change. Adding a deprecation warning may help such projects to understand they should update their templates.

For projects that find it is a burden to update, they've had 10 years to do so. I think adding more time isn't what they need at this point. The actual upgrade can be mostly automated with sed (I could even put a recommended command in the release notes). So the update doesn't need to be very time consuming.

While perhaps we agree leaving old code around can mostly go unnoticed, technical debt has subtle ways of showing up. For example, time was spent by me rediscovering this feature exists and wondering why there are two way to write {% if ... %} (this could happen to other contributors studying the template tag system). Time has been spent on this mailing list discussing what to do with old unused code. Its tests -- which mostly don't matter at this point -- run on every PR and in local environments. If there is ever an attempt at an internal refactoring of the template code, the ifequal tag will need to be considered and maintained. And so on.

On Sun, Aug 9, 2015 at 12:37 PM Collin Anderson <[hidden email]> wrote:
Hi All,

I really like the "don't use this on new code, but there's no rush in replacing it" category. I think that's really important to have that in a project that's this old. I think it would be great to minimize the amount required changes that need to be done.

Thanks,
Collin

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/2ddf20f1-af1a-47c1-b07c-669818846b53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CADhq2b5%3D3A03OjPTGa7mUgm-7braWgJwLUU_xW5pFJrgPP6Uow%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Ticket #25236: Remove ifequal from the template language

Adam Johnson-2
+1 for removal. 5 years have nearly passed since that discussion with the docs saying "The ifequal and ifnotequal tags will be deprecated in a future release." so I think it's worth actioning.

(I could even put a recommended command in the release notes).

I like this idea. It would also be worth having a sentence that one could extract them as custom template tags as Tim noted previously.

On Mon, 4 May 2020 at 15:08, Jon Dufresne <[hidden email]> wrote:
Hi,

I'd like to raise this topic for renewed discussion. I think it is time to begin deprecating the obsolete template tags. So +1 for removal.

I had all but forgotten about the {% ifequal %} template tag and then eventually stumbled across it doing unrelated work. Upon rediscovering it as a practical duplicate of {% if %}, I thought I'd help out Django by deprecating it for eventual removal so that we're back to "one -- and preferably only one -- obvious way to do it". I created the PR to begin the deprecation here: https://github.com/django/django/pull/12851

We're now coming up on 10 years since Django 1.2 was released with the smart if template tag. Projects and third party apps have had a generous extended time to update their code.

For projects that don't follow Django releases in detail, they may not be aware that the {% ifequal %} tag is obsolete and so have not had any motivation to change. Adding a deprecation warning may help such projects to understand they should update their templates.

For projects that find it is a burden to update, they've had 10 years to do so. I think adding more time isn't what they need at this point. The actual upgrade can be mostly automated with sed (I could even put a recommended command in the release notes). So the update doesn't need to be very time consuming.

While perhaps we agree leaving old code around can mostly go unnoticed, technical debt has subtle ways of showing up. For example, time was spent by me rediscovering this feature exists and wondering why there are two way to write {% if ... %} (this could happen to other contributors studying the template tag system). Time has been spent on this mailing list discussing what to do with old unused code. Its tests -- which mostly don't matter at this point -- run on every PR and in local environments. If there is ever an attempt at an internal refactoring of the template code, the ifequal tag will need to be considered and maintained. And so on.

On Sun, Aug 9, 2015 at 12:37 PM Collin Anderson <[hidden email]> wrote:
Hi All,

I really like the "don't use this on new code, but there's no rush in replacing it" category. I think that's really important to have that in a project that's this old. I think it would be great to minimize the amount required changes that need to be done.

Thanks,
Collin

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/2ddf20f1-af1a-47c1-b07c-669818846b53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CADhq2b5%3D3A03OjPTGa7mUgm-7braWgJwLUU_xW5pFJrgPP6Uow%40mail.gmail.com.


--
Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM1h-DS1aNLBs5wL25sNxAjDqMF_Z2fvX5ECD1kLO%2BjtmA%40mail.gmail.com.
12