--
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...@googlegroups.com.
To post to this group, send email to django...@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/fb2ab520-178d-4a0c-acf7-8cb0498936e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Validation of Constraints
In general constraints are not checked during
full_clean(), and do not raiseValidationErrors. Rather you’ll get a database integrity error onsave().UniqueConstraints are different in this regard, in that they leverage the existingvalidate_unique()logic, and thus enable two-stage validation. In addition toIntegrityErroronsave(),ValidationErroris also raised during model validation when theUniqueConstraintis violated.