[2.2.x] Refs #30547 -- Clarified that partial UniqueConstraints don't affect model validation.
Backport of 230d75f59c
from master
This commit is contained in:
parent
4814db40c1
commit
0088e59292
|
@ -32,11 +32,12 @@ option.
|
|||
|
||||
In general constraints are **not** checked during ``full_clean()``, and do
|
||||
not raise ``ValidationError``\s. Rather you'll get a database integrity
|
||||
error on ``save()``. ``UniqueConstraint``\s are different in this regard,
|
||||
in that they leverage the existing ``validate_unique()`` logic, and thus
|
||||
enable two-stage validation. In addition to ``IntegrityError`` on
|
||||
``save()``, ``ValidationError`` is also raised during model validation when
|
||||
the ``UniqueConstraint`` is violated.
|
||||
error on ``save()``. ``UniqueConstraint``\s without a
|
||||
:attr:`~UniqueConstraint.condition` (i.e. non-partial unique constraints)
|
||||
are different in this regard, in that they leverage the existing
|
||||
``validate_unique()`` logic, and thus enable two-stage validation. In
|
||||
addition to ``IntegrityError`` on ``save()``, ``ValidationError`` is also
|
||||
raised during model validation when the ``UniqueConstraint`` is violated.
|
||||
|
||||
``CheckConstraint``
|
||||
===================
|
||||
|
|
Loading…
Reference in New Issue