Opened 15 years ago

Closed 15 years ago

#13185 closed (invalid)

optiongroups for ChoiceField - any iterable?

Reported by: Paul Garner 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

Description

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 by Alex Gaynor, 15 years ago

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

comment:2 by Russell Keith-Magee, 15 years ago

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