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 HttpsFaxBoxForm(forms.ModelForm):
>     error_css_class = 'form_error'

> 
> And I run validation in my models(keep the admin page consistent) like this:

But your form is valid, so why should it apply error classes?
 
If you want to keep the admin page consistent, use the same form for admin, 
but your core problem is that you mix input validation (task of form) with 
data consistency (task of model). Keep those separated as much as possible and 
things will go smoother.
-- 
Melvyn Sopacua


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1743720.jJN2cR3phd%40fritzbook.
For more options, visit https://groups.google.com/d/optout.

Reply via email to