From 7f27cca5c509f3a3c0e9772dec7012a1c24247c3 Mon Sep 17 00:00:00 2001 From: Guillaume Pannatier Date: Wed, 4 Jun 2014 15:58:28 +0200 Subject: [PATCH] Fixed #22710 -- Amended aggregation note for empty QuerySets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks smeaton for report and Joël Rochat for spell check --- docs/ref/models/querysets.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 0328295c9b..242a4dc2e1 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -2633,9 +2633,10 @@ aggregate functions, see .. admonition:: Note - Aggregation functions will return ``None`` when used with an empty - ``QuerySet``. For example, the ``Count`` aggregation function will return - ``None`` instead of ``0`` if the ``QuerySet`` contains no entries. + Aggregation functions return ``None`` when used with an empty + ``QuerySet``. For example, the ``Sum`` aggregation function returns ``None`` + instead of ``0`` if the ``QuerySet`` contains no entries. An exception is + ``Count``, which does return ``0`` if the ``QuerySet`` is empty. Avg ~~~