Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13231 closed (fixed)

Make render_option() on the Select class an instance method

Reported by: bjourne Owned by: nobody
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The Select widget has a method called render_options() which renders all the options on the widget. For each option, it calls the inner method render_option() to render the "<option blah>...</option>"-tag. If you are creating a custom Select widget and you only need to override how the option tags are rendered, it would be convenient if render_option() was an instance method so that you don't have to override the whole render_options() method.

Change History (3)

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by russellm

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

(In [13577]) Fixed #13679, #13231, #7287 -- Ensured that models that have ForeignKeys/ManyToManyField can use a a callable default that returns a model instance/queryset. #13679 was a regression in behavior; the other two tickets are pleasant side effects. Thanks to 3point2 for the report.

comment:3 Changed 5 years ago by russellm

(In [13578]) [1.2.X] Fixed #13679, #13231, #7287 -- Ensured that models that have ForeignKeys/ManyToManyField can use a a callable default that returns a model instance/queryset. #13679 was a regression in behavior; the other two tickets are pleasant side effects. Thanks to 3point2 for the report.

Backport of r13577 from trunk.

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