Reading django-crispy-forms I noticed than:
The way you do horizontal forms in Bootstrap version 3 is setting some col-lg-X classes in labels and divs wrapping fields. This would mean a lot of hassle updating your layout objects for settings these classes, too much verbosity. Instead some FormHelper attributes have been added to help you easily achieve this.
And an example is provided:
helper.label_class = 'col-lg-2'
helper.field_class = 'col-lg-8'
My question is:
How can I change default label_class
or field_class
for a form field?
In bootstrap doc sample:
helper.label_class = 'col-lg-2'
helper.field_class = 'col-lg-8'
helper.layout = Layout(
'email', #<--- How to set class to 'col-lg-4' only for this field?
'password',
'remember_me',
StrictButton('Sign in', css_class='btn-default'),
)