[patch] ChoiceField should allow for nested choice sets
It would be really useful for the ChoiceField choices parameter to allow grouped sets of chioces (much like the Admin class allows for grouped fields). That way, the default widget could output HTML which encloses groups of OPTION tags within OPTGROUP tags.
Attachments
(3)
- widgets.diff
(2.2 KB
) - added by tbarta@… 18 years ago.
- patch to add
groupedSelect
widget that works with existing ChoiceField
class
- example.py
(676 bytes
) - added by tbarta@… 18 years ago.
- example usage of
GroupedSelect
- grouped_select.diff
(2.4 KB
) - added by Thejaswi Puthraya 17 years ago.
- Added the GroupSelect Widget to django.newforms.extras.widgets and added support for unicode and mark_safe
Download all attachments as:
.zip
Change History
(12)
Triage Stage: |
Unreviewed → Design decision needed
|
Triage Stage: |
Design decision needed → Accepted
|
Summary: |
ChoiceField should allow for nested choice sets → [patch] ChoiceField should allow for nested choice sets
|
Owner: |
changed from nobody to Thejaswi Puthraya
|
Cc: |
tbarta@gmail.com → tbarta@gmail.com,
|
Keywords: |
sprintdec01 added
|
Triage Stage: |
Accepted → Ready for checkin
|
Triage Stage: |
Ready for checkin → Accepted
|
Resolution: |
→ duplicate
|
Status: |
new → closed
|
Sure, that'd be a pretty good improvement. Please implement this as
GroupedChoiceField
and put it indjango/newforms/extras
, along with aGroupedChoiceWidget
.