Code

Opened 4 years ago

Closed 4 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: UI/UX:

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?

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 4 years ago by russellm

  • Resolution set to invalid
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.