Document what happens during model validation with Meta.constraints.
The current constraints reference does not mention whether or not a ValidationError is raised during model validation if a constraint fails. The documentation only mentions that a database constraint is created.
However, for the soon to be deprecated unique_together
, there is a reference to model validation.
As far as I can see, a UniqueConstraint
causes validate_unique()
to check for uniqueness and raises a ValidationError. But a CheckConstraint
does not cause a ValidationError when the model is validated. I believe it's important to mention this in the documentation.
Change History
(11)
Easy pickings: |
set
|
Summary: |
Specify what happens during model validation with Meta.constraints → Document what happens during model validation with Meta.constraints.
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to Swatantra
|
Status: |
new → assigned
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Cc: |
Kevin Christopher Henry added
|
PR