summaryrefslogtreecommitdiff
path: root/docs/releases/5.0.txt
diff options
context:
space:
mode:
authorXavier Fernandez <xavier.fernandez@beta.gouv.fr>2023-02-14 21:06:45 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-02-23 10:58:20 +0100
commit5b3d3e400ab9334ba429ca360c9818c6dfc3a51b (patch)
tree03bd0bc014819b45f3941917a9faf9e2a8eb5bdc /docs/releases/5.0.txt
parent51c9bb7cd16081133af4f0ab6d06572660309730 (diff)
downloaddjango-5b3d3e400ab9334ba429ca360c9818c6dfc3a51b.tar.gz
Fixed #34338 -- Allowed customizing code of ValidationError in BaseConstraint and subclasses.
Diffstat (limited to 'docs/releases/5.0.txt')
-rw-r--r--docs/releases/5.0.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/docs/releases/5.0.txt b/docs/releases/5.0.txt
index 14e767cfd8..84689f223d 100644
--- a/docs/releases/5.0.txt
+++ b/docs/releases/5.0.txt
@@ -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
~~~~~~~~~~~~~~~~~~~~~~