diff options
author | Gagaro <gagaro42@gmail.com> | 2022-01-31 16:04:13 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-05-10 11:22:23 +0200 |
commit | 667105877e6723c6985399803a364848891513cc (patch) | |
tree | b6b3a9fe9f2c8767bc6f6a68f0580eef021b2b55 /docs/ref/contrib/postgres | |
parent | 441103a04d1d167dc870eaaf90e3fba974f67c93 (diff) | |
download | django-667105877e6723c6985399803a364848891513cc.tar.gz |
Fixed #30581 -- Added support for Meta.constraints validation.
Thanks Simon Charette, Keryn Knight, and Mariusz Felisiak for reviews.
Diffstat (limited to 'docs/ref/contrib/postgres')
-rw-r--r-- | docs/ref/contrib/postgres/constraints.txt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/docs/ref/contrib/postgres/constraints.txt b/docs/ref/contrib/postgres/constraints.txt index 1c283c367e..26c6356693 100644 --- a/docs/ref/contrib/postgres/constraints.txt +++ b/docs/ref/contrib/postgres/constraints.txt @@ -12,7 +12,7 @@ PostgreSQL supports additional data integrity constraints available from the ``ExclusionConstraint`` ======================= -.. class:: ExclusionConstraint(*, name, expressions, index_type=None, condition=None, deferrable=None, include=None, opclasses=()) +.. class:: ExclusionConstraint(*, name, expressions, index_type=None, condition=None, deferrable=None, include=None, opclasses=(), violation_error_message=None) Creates an exclusion constraint in the database. Internally, PostgreSQL implements exclusion constraints using indexes. The default index type is @@ -27,6 +27,14 @@ PostgreSQL supports additional data integrity constraints available from the :exc:`~django.db.IntegrityError` is raised. Similarly, when update conflicts with an existing row. + Exclusion constraints are checked during the :ref:`model validation + <validating-objects>`. + + .. versionchanged:: 4.1 + + In older versions, exclusion constraints were not checked during model + validation. + ``name`` -------- @@ -165,6 +173,15 @@ creates an exclusion constraint on ``circle`` using ``circle_ops``. :class:`OpClass() <django.contrib.postgres.indexes.OpClass>` in :attr:`~ExclusionConstraint.expressions`. +``violation_error_message`` +--------------------------- + +.. versionadded:: 4.1 + +The error message used when ``ValidationError`` is raised during +:ref:`model validation <validating-objects>`. Defaults to +:attr:`.BaseConstraint.violation_error_message`. + Examples -------- |