From a5b4c680f3e45ab125dcabbb79c7e7ccf319d717 Mon Sep 17 00:00:00 2001 From: Chris Muthig Date: Wed, 14 Aug 2024 13:54:09 -0600 Subject: [PATCH] Refs #35444 -- Deprecated contrib.postgres.OrderableAggMixin This commit does not create any functional changes, but marks the existing `OrderableAggMixin` class as deprecated so that developers using it directly can be made aware of its future removal. --- django/contrib/postgres/aggregates/mixins.py | 6 ++++++ docs/internals/deprecation.txt | 3 +++ docs/releases/5.2.txt | 3 +++ 3 files changed, 12 insertions(+) diff --git a/django/contrib/postgres/aggregates/mixins.py b/django/contrib/postgres/aggregates/mixins.py index 8183707bc4..3f897132dd 100644 --- a/django/contrib/postgres/aggregates/mixins.py +++ b/django/contrib/postgres/aggregates/mixins.py @@ -23,4 +23,10 @@ class OrderableAggMixin(_DeprecatedOrdering): allow_order_by = True def __init_subclass__(cls, /, *args, **kwargs): + warnings.warn( + "OrderableAggMixin is deprecated. Use Aggregate and allow_order_by " + "instead.", + category=RemovedInDjango61Warning, + stacklevel=1, + ) super().__init_subclass__(*args, **kwargs) diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index e9e887adea..885c57ff7a 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -28,6 +28,9 @@ details on these changes. * The ``django.contrib.postgres.aggregates.StringAgg`` class will be removed. +* The ``django.contrib.postgres.aggregates.mixins.OrderableAggMixin`` class + will be removed. + .. _deprecation-removed-in-6.0: 6.0 diff --git a/docs/releases/5.2.txt b/docs/releases/5.2.txt index a490be322f..8b504ebaf3 100644 --- a/docs/releases/5.2.txt +++ b/docs/releases/5.2.txt @@ -499,3 +499,6 @@ Miscellaneous * The PostgreSQL ``StringAgg`` class is deprecated in favor of the generally available ``StringAgg`` class. + +* The PostgreSQL ``OrderableAggMixin`` is deprecated in favor of the + ``order_by`` attribute now available on the ``Aggregate`` class.