django-widget-tweaks
django-widget-tweaks copied to clipboard
Tweak the form field rendering in templates, not in python-level form definitions. CSS classes and HTML attributes can be altered.
I just ran across your package today - very convenient! I had previously viewed a StackOverflow post from someone who had created a Django filter to add a Bootstrap class...
With Django 5.0 BoundField.as_field_group() is available. Right now this library only uses str(bounded_field). Can we have an option to use the render() method?
Even setting in django settings: ``` DATE_FORMAT = "%d/%m/%Y" ``` when I use dender_field ``` {% render_field form.my_date class="form-control" type="date" %} ``` show `mm/dd/yyyy` format, instead of the settings config....
`{% render_field signupForm.date_of_birth value=request.user.date_of_birth|date:"Y-m-d" class="form-control datepicker" id="date_of_birth" required="true"%}` if you see i want format Y-m-d, but Im not able to use that filter. Django throws error. Thank you.
I have added to the readme a short explanation on how to render any form related errors. I was stuck on rendering non field related errors for couple of hours...
It's quite a simple addition. There is one disadvantage to this approach, which is that it assumes that the subfield will only be rendered with_label=False. I did this because it's...
It's possible to render choice fields this way: ``` {% for radio in form.my_radio_field %} {{ radio.tag }} {{ radio.choice_label }} {% endfor %} ``` This gives more control over...
ModuleNotFoundError: No module named 'widget_tweaks'
Would it be possible to add `WIDGET_ERROR_CLASS` and `WIDGET_REQUIRED_CLASS` as settings? Can be an alternative to context processor.
This is for Firefox browser. In forms, added required=False in both forms.CharField(required=False) and forms.BooleanField(required=False). Checked Firefox inspector. For CharField, the "required" is not added and can be submitted without adding...