diff options
| author | Xavier Fernandez <xavier.fernandez@beta.gouv.fr> | 2023-02-14 21:06:45 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-02-23 10:58:20 +0100 |
| commit | 5b3d3e400ab9334ba429ca360c9818c6dfc3a51b (patch) | |
| tree | 03bd0bc014819b45f3941917a9faf9e2a8eb5bdc /docs/ref/contrib/postgres | |
| parent | 51c9bb7cd16081133af4f0ab6d06572660309730 (diff) | |
Fixed #34338 -- Allowed customizing code of ValidationError in BaseConstraint and subclasses.
Diffstat (limited to 'docs/ref/contrib/postgres')
| -rw-r--r-- | docs/ref/contrib/postgres/constraints.txt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/docs/ref/contrib/postgres/constraints.txt b/docs/ref/contrib/postgres/constraints.txt index fcf50b8b5f..abc5e4e4e4 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, violation_error_message=None) +.. class:: ExclusionConstraint(*, name, expressions, index_type=None, condition=None, deferrable=None, include=None, violation_error_code=None, violation_error_message=None) Creates an exclusion constraint in the database. Internally, PostgreSQL implements exclusion constraints using indexes. The default index type is @@ -133,6 +133,16 @@ used for queries that select only included fields ``include`` is supported for GiST indexes. PostgreSQL 14+ also supports ``include`` for SP-GiST indexes. +``violation_error_code`` +------------------------ + +.. versionadded:: 5.0 + +.. attribute:: ExclusionConstraint.violation_error_code + +The error code used when ``ValidationError`` is raised during +:ref:`model validation <validating-objects>`. Defaults to ``None``. + ``violation_error_message`` --------------------------- |
