Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12215 closed (fixed)

ModelChoiceIterator doesn't define __len__

Reported by: Alex Gaynor Owned by: Karen Tracey
Component: Forms Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This means one can't necessarily call len(field.choices) if hasattr(field.choices), which would be nice.

Attachments (3)

modelchoice_iterator_len.diff (1.6 KB ) - added by Alex Gaynor 15 years ago.
modelchoice_iterator_len.2.diff (1.6 KB ) - added by Alex Gaynor 15 years ago.
modelchoice_iterator_len.3.diff (1.4 KB ) - added by Tobias McNulty 15 years ago.
same patch w/extra whitespace removed

Download all attachments as: .zip

Change History (11)

comment:1 by Alex Gaynor, 15 years ago

by Alex Gaynor, 15 years ago

by Alex Gaynor, 15 years ago

comment:2 by kgrandis, 15 years ago

Owner: changed from nobody to kgrandis
Status: newassigned

comment:3 by kgrandis, 15 years ago

Has patch: set
Owner: changed from kgrandis to nobody
Status: assignednew

by Tobias McNulty, 15 years ago

same patch w/extra whitespace removed

comment:4 by Tobias McNulty, 15 years ago

Triage Stage: UnreviewedAccepted

Applied and tested; works fine.

Seems like a small, intuitive change to me and not something anyone would complain about. It doesn't look like we document ModelChoiceIterator anyways, so this probably doesn't need docs.

Marking Accepted but it's probably RFC.

comment:5 by Jeremy Dunck, 15 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Tobias McNulty, 15 years ago

Owner: changed from nobody to Karen Tracey

comment:7 by Karen Tracey, 15 years ago

Resolution: fixed
Status: newclosed

(In [11850]) Fixed #12215: Added len to ModelChoiceIterator. Thanks Alex and Tobias.

comment:8 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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