Hello friends, I'm having a problem with a modelForm in django 1.8, the code is as follows:
class TrabajoForm(forms.ModelForm):
class Meta:
model = Trabajo
exclude = ['fecha_solicitud', 'revisado']
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for field in self.fields:
fields[field].widget.attrs.update({'class': 'form-control'})
What I want is to give a css class to all the fields of the form, according to the error that Django gives me when using it, the 'self' is not defined, what can I do?
Thank you very much !!! :)