-
Django-formset version: 0.13.4. Based on chapter 11 of the documentation ("Form Renderers"), it should be possible to add CSS classes to forms and fields of simple forms using this in views.py:
The
The header.html sees to the loading of the bootstrap files as needed. With this in place, the rendered output does not include any of the CSS classes associated with the renderer. If I replace the
the specified classes do make it into the rendered HTML and therefore take effect. I have obviously missed something about the way FormRenderer's field_css_classes option works. Can someone point out what I've overlooked? I first observed the problem with a form subclassed from ModelForm. The above forms.Form example turns out to do the same thing, so I've used that as the test case as it's simpler. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
you should add Sorry, if that's not clear from reading the docs. |
Beta Was this translation helpful? Give feedback.
-
Thanks for reporting. I missed that one. |
Beta Was this translation helpful? Give feedback.
you should add
formset.utils.FormMixin
to your classTestForm
. If doing so, there is no need to use theform_renderer
in the template. You then can just write{{ form }}
.Sorry, if that's not clear from reading the docs.