diff options
| author | David Wobrock <david.wobrock@gmail.com> | 2021-09-24 22:05:02 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-29 20:52:59 +0200 |
| commit | aab76433ed585ebe997b94547e0d790605e01ad9 (patch) | |
| tree | 48329f6a7adebfd0802120150f329d0aac7830d1 /docs | |
| parent | cebac15931173b2fc5d8f2b3f4bd69fe1a8a856d (diff) | |
[4.0.x] Fixed #33141 -- Renamed Expression.empty_aggregate_value to empty_result_set_value.
Backport of ad36a198a12df4dff65992191b3eb0a474e2daac from main
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/expressions.txt | 12 | ||||
| -rw-r--r-- | docs/releases/4.0.txt | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 64a7136e6e..c0ef4a46d0 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -418,11 +418,11 @@ The ``Aggregate`` API is as follows: allows passing a ``distinct`` keyword argument. If set to ``False`` (default), ``TypeError`` is raised if ``distinct=True`` is passed. - .. attribute:: empty_aggregate_value + .. attribute:: empty_result_set_value .. versionadded:: 4.0 - Override :attr:`~django.db.models.Expression.empty_aggregate_value` to + Override :attr:`~django.db.models.Expression.empty_result_set_value` to ``None`` since most aggregate functions result in ``NULL`` when applied to an empty result set. @@ -976,14 +976,14 @@ calling the appropriate methods on the wrapped expression. in :class:`~django.db.models.expressions.Window`. Defaults to ``False``. - .. attribute:: empty_aggregate_value + .. attribute:: empty_result_set_value .. versionadded:: 4.0 Tells Django which value should be returned when the expression is used - to :meth:`aggregate <django.db.models.query.QuerySet.aggregate>` over - an empty result set. Defaults to :py:data:`NotImplemented` which forces - the expression to be computed on the database. + to apply a function over an empty result set. Defaults to + :py:data:`NotImplemented` which forces the expression to be computed on + the database. .. method:: resolve_expression(query=None, allow_joins=True, reuse=None, summarize=False, for_save=False) diff --git a/docs/releases/4.0.txt b/docs/releases/4.0.txt index 4bc3fa7678..9089117215 100644 --- a/docs/releases/4.0.txt +++ b/docs/releases/4.0.txt @@ -318,8 +318,9 @@ Models * :meth:`.QuerySet.bulk_update` now returns the number of objects updated. -* The new :attr:`.Aggregate.empty_aggregate_value` attribute allows specifying - a value to return when the aggregation is used over an empty result set. +* The new :attr:`.Expression.empty_result_set_value` attribute allows + specifying a value to return when the function is used over an empty result + set. * The ``skip_locked`` argument of :meth:`.QuerySet.select_for_update()` is now allowed on MariaDB 10.6+. |
