As I am using some more exotic css framework I would like to change the behaviour of the text input (provide it with label etc. by default).
- I have overridden the template in
django/forms/widgets/input.html
Unfortunately the widget context is missing the field, so I cannot use field properties like help_text, label, etc in my template. Therefore I would need to override the TextInput widget.
My two options are now:
Setting my own widget class for every single field in my
Form/ModelformclassesUsing My custom
ModelFormwhich iterates all the fields in__init__and replaces the widget.Is there any better way to override django's default
text_inputwidget?Does is there any other way to get
field.errorsandfield.labelinto the widget (Or is there a reason why there is no label in the widget context)?