Modify ↓
Opened 14 years ago
Last modified 12 years ago
#8630 new enhancement
Provide an option to not sort the drop down alphabetically
Reported by: | Owned by: | Richard Liao | |
---|---|---|---|
Priority: | normal | Component: | TracTicketChainedFieldsPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Chained fields drop downs are currently sorted alphabetically, but this can result in an uncommon value being shown first, when the designer may wish to have some other more common value be the default.
Attachments (0)
Note: See
TracTickets for help on using
tickets.
Just from playing around with the source code, I was able to disable the alphabetic sorting by modifying web_ui.py. I removed the line
target_options.sort(cmp=lambda x,y: cmp(x.lower(), y.lower()))
on line 217 and changed the lines that called tosimplejson.loads(tcf_define)
to besimplejson.loads(tcf_define, object_pairs_hooks=collections.OrderedDict)
. I also obviously added an import collections call. This will only work for>Python 2.7
. For earlier versions, you have to use the ordereddict library instead of the collections library. I can upload a diff, if that would be helpful.