summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorXavier Fernandez <xavier.fernandez@beta.gouv.fr>2023-02-20 14:28:21 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-02-22 09:37:58 +0100
commitad18a0102cc2968914232814c6554763f15abbe3 (patch)
treea1f1bf008334d871cb97951be3f7513cafe7d21b /docs
parent31cd2852cb86197d5f3f5a637184a078ab0615f8 (diff)
Fixed #34355 -- Deprecated passing positional arguments to BaseConstraint.
Diffstat (limited to 'docs')
-rw-r--r--docs/internals/deprecation.txt3
-rw-r--r--docs/ref/models/constraints.txt6
-rw-r--r--docs/releases/5.0.txt4
3 files changed, 12 insertions, 1 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 9ada56cf6c..b151020375 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -18,6 +18,9 @@ details on these changes.
* The ``DjangoDivFormRenderer`` and ``Jinja2DivFormRenderer`` transitional form
renderers will be removed.
+* Support for passing positional arguments to ``BaseConstraint`` will be
+ removed.
+
.. _deprecation-removed-in-5.1:
5.1
diff --git a/docs/ref/models/constraints.txt b/docs/ref/models/constraints.txt
index 6ce00ae979..baaacd8754 100644
--- a/docs/ref/models/constraints.txt
+++ b/docs/ref/models/constraints.txt
@@ -48,12 +48,16 @@ option.
``BaseConstraint``
==================
-.. class:: BaseConstraint(name, violation_error_message=None)
+.. class:: BaseConstraint(*, name, violation_error_message=None)
Base class for all constraints. Subclasses must implement
``constraint_sql()``, ``create_sql()``, ``remove_sql()`` and
``validate()`` methods.
+ .. deprecated:: 5.0
+
+ Support for passing positional arguments is deprecated.
+
All constraints have the following parameters in common:
``name``
diff --git a/docs/releases/5.0.txt b/docs/releases/5.0.txt
index 3e14e17972..14e767cfd8 100644
--- a/docs/releases/5.0.txt
+++ b/docs/releases/5.0.txt
@@ -267,6 +267,10 @@ Miscellaneous
* The ``DjangoDivFormRenderer`` and ``Jinja2DivFormRenderer`` transitional form
renderers are deprecated.
+* Passing positional arguments ``name`` and ``violation_error_message`` to
+ :class:`~django.db.models.BaseConstraint` is deprecated in favor of
+ keyword-only arguments.
+
Features removed in 5.0
=======================