summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDavid Wobrock <david.wobrock@gmail.com>2021-09-24 22:05:02 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-09-29 12:58:01 +0200
commitad36a198a12df4dff65992191b3eb0a474e2daac (patch)
treea890154a129f003f703c5b75e70f61c156d19b33 /docs
parent9466fd78420a851460c92673dad50a5737c75b12 (diff)
Fixed #33141 -- Renamed Expression.empty_aggregate_value to empty_result_set_value.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/expressions.txt12
-rw-r--r--docs/releases/4.0.txt5
2 files changed, 9 insertions, 8 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt
index ee4093e98a..f938213bdd 100644
--- a/docs/ref/models/expressions.txt
+++ b/docs/ref/models/expressions.txt
@@ -414,11 +414,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.
@@ -959,14 +959,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+.