1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #34355 -- Deprecated passing positional arguments to BaseConstraint.

This commit is contained in:
Xavier Fernandez
2023-02-20 14:28:21 +01:00
committed by Mariusz Felisiak
parent 31cd2852cb
commit ad18a0102c
5 changed files with 64 additions and 13 deletions

View File

@@ -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

View File

@@ -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``

View File

@@ -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
=======================