Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#12215 closed (fixed)

ModelChoiceIterator doesn't define __len__

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

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 6 years ago.
modelchoice_iterator_len.2.diff (1.6 KB) - added by Alex 6 years ago.
modelchoice_iterator_len.3.diff (1.4 KB) - added by tobias 6 years ago.
same patch w/extra whitespace removed

Download all attachments as: .zip

Change History (11)

comment:1 Changed 6 years ago by Alex

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

Changed 6 years ago by Alex

Changed 6 years ago by Alex

comment:2 Changed 6 years ago by kgrandis

  • Owner changed from nobody to kgrandis
  • Status changed from new to assigned

comment:3 Changed 6 years ago by kgrandis

  • Has patch set
  • Owner changed from kgrandis to nobody
  • Status changed from assigned to new

Changed 6 years ago by tobias

same patch w/extra whitespace removed

comment:4 Changed 6 years ago by tobias

  • Triage Stage changed from Unreviewed to 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 Changed 6 years ago by jdunck

  • Triage Stage changed from Accepted to Ready for checkin

comment:6 Changed 6 years ago by tobias

  • Owner changed from nobody to kmtracey

comment:7 Changed 6 years ago by kmtracey

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

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

comment:8 Changed 4 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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