Opened 16 years ago

Closed 13 years ago

#6786 closed New feature (wontfix)

Ordering choices after translation

Reported by: David Avsajanishvili <avsd05@…> Owned by: nobody
Component: Core (Other) Version: dev
Severity: Normal Keywords: order choices field
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Added order parameter to constructor of db.models.Field class, that specifies ordering of choices list.
Ordering is performed after translation, so localized lists are ordered correctly.

The ordering was tested successfully both on CharField with choices and ForeignKey field.

Attachments (2)

choices_order.diff (4.0 KB ) - added by David Avsajanishvili <avsd05@…> 16 years ago.
changes in db.models.Field constructor and it's docs
choices_sort.diff (3.9 KB ) - added by David Avsajanishvili <avsd05@…> 16 years ago.
Renamed parameter "order" to "sort"

Download all attachments as: .zip

Change History (6)

by David Avsajanishvili <avsd05@…>, 16 years ago

Attachment: choices_order.diff added

changes in db.models.Field constructor and it's docs

by David Avsajanishvili <avsd05@…>, 16 years ago

Attachment: choices_sort.diff added

Renamed parameter "order" to "sort"

comment:1 by David Avsajanishvili <avsd05@…>, 16 years ago

Renamed parameter from "order" to "sort"
and tested the system again.
Everything is working!

comment:2 by David Avsajanishvili <avsd05@…>, 16 years ago

Has patch: set
Needs tests: set
Triage Stage: UnreviewedDesign decision needed

comment:3 by Julien Phalip, 13 years ago

Severity: Normal
Type: New feature

comment:4 by Alex Gaynor, 13 years ago

Easy pickings: unset
Resolution: wontfix
Status: newclosed
UI/UX: unset

Discussion with Carl: sorting choices for display is not a model-level concern, it is a form-level concern and this solves it at the right level. the right solution is for forms that want to display choices in a different order to override init and resort their field's choices.

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