Opened 11 years ago

Closed 10 years ago

#13185 closed (invalid)

optiongroups for ChoiceField - any iterable?

Reported by: anentropic Owned by: nobody
Component: Documentation Version: 1.2-beta
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The documentation for choices of a ChoiceField says you can use any iterable to make a nested structure to represent optiongroups... not necessarily a list or tuple.

In the code for ChoiceField.valid_value it uses this test though:

if type(v) in (tuple, list):

Seems like maybe it should use some kind of is_iterable() test function instead if it is to match the docs?

Change History (2)

comment:1 Changed 11 years ago by Alex Gaynor

Is there a real usecase for this, or just "architectural wankery", as they say :)?

comment:2 Changed 10 years ago by Russell Keith-Magee

Resolution: invalid
Status: newclosed

Agreed. Without a concrete use case, this is just shuffling deckchairs.

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