From ad18a0102cc2968914232814c6554763f15abbe3 Mon Sep 17 00:00:00 2001 From: Xavier Fernandez Date: Mon, 20 Feb 2023 14:28:21 +0100 Subject: Fixed #34355 -- Deprecated passing positional arguments to BaseConstraint. --- docs/internals/deprecation.txt | 3 +++ docs/ref/models/constraints.txt | 6 +++++- docs/releases/5.0.txt | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'docs') 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 ======================= -- cgit v1.3