Re: [Django] #6904: Dictsort filter should sort case insensitive

83 views
Skip to first unread message

Django

unread,
Jul 1, 2011, 8:54:22 PM7/1/11
to django-...@googlegroups.com
#6904: Dictsort filter should sort case insensitive
-------------------------------------+-------------------------------------
Reporter: michael@… | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Template system
Version: SVN | Severity: Normal
Resolution: | Keywords:
Triage Stage: Design | Has patch: 1
decision needed | Needs tests: 0
Needs documentation: 1 | Easy pickings: 0
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by anonymous):

* ui_ux: => 0
* easy: => 0


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

Django

unread,
Sep 11, 2011, 2:51:16 PM9/11/11
to django-...@googlegroups.com
#6904: Dictsort filter should sort case insensitive
---------------------------------------+---------------------------------
Reporter: michael@… | Owner: nobody
Type: New feature | Status: new
Milestone: | Component: Template system
Version: SVN | Severity: Normal
Resolution: | Keywords:
Triage Stage: Accepted | Has patch: 1
Needs documentation: 1 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------+---------------------------------
Changes (by carljm):

* type: Bug => New feature
* stage: Design decision needed => Accepted


Comment:

I don't think case-sensitive ordering is so obviously wrong in all cases
that we can just change the behavior backwards-incompatibly and force
anyone who wants the current behavior to implement their own filter.

Accepting this on the basis that it would be reasonable to add something
like "idictsort", since case-insensitive would frequently be preferable
for strings. It would also be worth looking in more detail at whether
there are any downsides to using locale collation for this new tag rather
than simple .lower(), as Michael Jung suggests.

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

Django

unread,
Apr 18, 2013, 6:03:08 AM4/18/13
to django-...@googlegroups.com
#6904: Dictsort filter should sort case insensitive
---------------------------------+------------------------------------

Reporter: michael@… | Owner: nobody
Type: New feature | Status: new
Component: Template system | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by bmispelon):

* cc: bmispelon@… (added)


Comment:

For what it's worth, it's already possible to do `dictsort:'foo.lower'` so
I'm -1 on introducing a new tag.

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

Django

unread,
Jul 16, 2013, 6:22:34 AM7/16/13
to django-...@googlegroups.com
#6904: Dictsort filter should sort case insensitive
---------------------------------+------------------------------------
Reporter: michael@… | Owner: nobody
Type: New feature | Status: closed

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

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by timo):

* status: new => closed
* resolution: => wontfix


Comment:

Agreed with bmispelon. If there's a case where `foo.lower` won't work,
please re-open.

--
Ticket URL: <https://code.djangoproject.com/ticket/6904#comment:14>

Django

unread,
Jun 27, 2022, 8:52:53 AM6/27/22
to django-...@googlegroups.com
#6904: Dictsort filter should sort case insensitive
---------------------------------+------------------------------------
Reporter: michael@… | Owner: nobody
Type: New feature | Status: new
Component: Template system | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Alex-siem):

* status: closed => new
* resolution: wontfix =>


Comment:

Reopening, because as of 4.0.1 {{{dictsort:'foo.lower'}}} is not possible
anymore, due to CVE-2021-45116

--
Ticket URL: <https://code.djangoproject.com/ticket/6904#comment:15>

Django

unread,
Jun 27, 2022, 11:50:11 AM6/27/22
to django-...@googlegroups.com
#6904: Dictsort filter should sort case insensitive
---------------------------------+------------------------------------
Reporter: michael@… | Owner: nobody
Type: New feature | Status: closed

Component: Template system | Version: dev
Severity: Normal | Resolution: wontfix
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 Mariusz Felisiak):

* status: new => closed

* needs_better_patch: 1 => 0
* has_patch: 1 => 0
* resolution: => wontfix
* needs_docs: 1 => 0


Comment:

The current thread is to keep Django a core framework, not providing every
utility which might be useful. You can write that filter in your own
library, e.g.
{{{#!python
@register.filter(is_safe=False)
def dictsortlower(value):
return sorted(value, key=str.lower)
}}}
You can start a discussion on DevelopersMailingList if you don't agree.

--
Ticket URL: <https://code.djangoproject.com/ticket/6904#comment:16>

Reply all
Reply to author
Forward
0 new messages