How to add classes to Fields in

Good afternoon, prompt how to add classes to the fields when creating your forms in ?
June 8th 19 at 17:31
1 answer
June 8th 19 at 17:33
This is detailed in the documentation:

class SomeForm(forms.ModelForm):
 class Meta:
 mode = SomeModel
 fields = ('one_field', 'another_field')
 labels = {
 'one_field': 'the Label is different from the field name in the model',
 widgets = {
 'another_field': forms.TextInput(attrs={'class': 'some-class', 'placeholder': 'Lorem ipsum'}),
Thank you! - martina commented on June 8th 19 at 17:36

Find more questions by tags DjangoPython