Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Melvyn Sopacua
On dinsdag 16 juli 2019 03:25:11 CEST Jacob Greene wrote: > Hello! Has anyone dealt with this before? It seems that my forms don't add > the CSS class to errors raised in model.clean() or model.clean_fields() > methods. > > I have a form that looks something like this: > > class

Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Jani Tiainen
Full_clean is Django internal method which you should't touch. .clean() method validation errors go to special non-field errors and by quick look it should get correct css class. If you could provide minimal project with suspected faulty behavior (for example in github) it would be easier to see

Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Jacob Greene
Thank you for the reply! And good catch haha, I'm not actually. I editing these by hand so I wasn't posting some confusing telephony terminology. I'm displaying errors in my templates by marking them with that "form_error" css class. They are just red and bold, most errors are shown with the

Re: ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-16 Thread Jani Tiainen
At least you should't call super.clean_fields() in clean() method... Also how are you outputting errors in your template? ti 16. heinäk. 2019 klo 5.22 Jacob Greene kirjoitti: > Hello! Has anyone dealt with this before? It seems that my forms don't add > the CSS class to errors raised in

ModelForm "error_css_class" not getting applied to ValidationErrors raised in model.clean()

2019-07-15 Thread Jacob Greene
Hello! Has anyone dealt with this before? It seems that my forms don't add the CSS class to errors raised in model.clean() or model.clean_fields() methods. I have a form that looks something like this: class HttpsFaxBoxForm(forms.ModelForm): error_css_class = 'form_error' class Meta: