Add a widget_callback to forms, modelforms, etc
|Reported by:||russellm||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Modelforms currently support (although undocumented) a formfield_callback method that can be used to control the widgets that are used for a form field. We also support the definition of a 'widgets' attribute in the Meta of a modelform that allows you to override the widget for a particular model field based on the name of the attribute.
We should be able to define a callback to alter the widget programatically, based on the form field that is being rendered.
Change History (4)
comment:1 Changed 6 years ago by russellm
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted