mirror of
https://github.com/django/django.git
synced 2025-08-27 05:54:28 +00:00
Fixed #34338 -- Allowed customizing code of ValidationError in BaseConstraint and subclasses.
This commit is contained in:
parent
51c9bb7cd1
commit
5b3d3e400a
7 changed files with 268 additions and 23 deletions
|
@ -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``
|
||||
---------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue