#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)
Change History (11)
comment:1 by , 15 years ago
by , 15 years ago
Attachment: | modelchoice_iterator_len.diff added |
---|
by , 15 years ago
Attachment: | modelchoice_iterator_len.2.diff added |
---|
comment:2 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 15 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | assigned → new |
by , 15 years ago
Attachment: | modelchoice_iterator_len.3.diff added |
---|
comment:4 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
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 , 15 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:6 by , 15 years ago
Owner: | changed from | to
---|
comment:7 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
same patch w/extra whitespace removed