mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #34338 -- Allowed customizing code of ValidationError in BaseConstraint and subclasses.
This commit is contained in:
committed by
Mariusz Felisiak
parent
51c9bb7cd1
commit
5b3d3e400a
@@ -78,7 +78,10 @@ Minor features
|
||||
:mod:`django.contrib.postgres`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* ...
|
||||
* The new :attr:`~.ExclusionConstraint.violation_error_code` attribute of
|
||||
:class:`~django.contrib.postgres.constraints.ExclusionConstraint` allows
|
||||
customizing the ``code`` of ``ValidationError`` raised during
|
||||
:ref:`model validation <validating-objects>`.
|
||||
|
||||
:mod:`django.contrib.redirects`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -182,6 +185,13 @@ Models
|
||||
and :meth:`.QuerySet.aupdate_or_create` methods allows specifying a different
|
||||
field values for the create operation.
|
||||
|
||||
* The new ``violation_error_code`` attribute of
|
||||
:class:`~django.db.models.BaseConstraint`,
|
||||
:class:`~django.db.models.CheckConstraint`, and
|
||||
:class:`~django.db.models.UniqueConstraint` allows customizing the ``code``
|
||||
of ``ValidationError`` raised during
|
||||
:ref:`model validation <validating-objects>`.
|
||||
|
||||
Requests and Responses
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user