Opened 7 years ago

Closed 7 years ago

#12110 closed (duplicate)

dictsort is not stable sort

Reported by: eronen Owned by: nobody
Component: Template system Version: 1.1
Severity: Keywords: dictsort
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I'm trying to sort a list first by owner, then by date, like this:

{% for item in items|dictsort:"date"|dictsort:"owner" %}

Python's sort method is stable (preserves the order if the sort key is the same), so I assumed dictsort would be, too.
But it's not!

Ticket #11008 has a patch which fixes this problem, too (although #11008 is not
about sort stability as such).

Change History (1)

comment:1 Changed 7 years ago by Russell Keith-Magee

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: duplicate
Status: newclosed

Duplicate of #11008 (if you interpret that ticket as "dictsort is broken")

Note: See TracTickets for help on using tickets.
Back to Top