Add a widget_callback to forms, modelforms, etc
|Reported by:||Russell Keith-Magee||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
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Accepted|