summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGuillaume Pannatier <guillaume.pannatier@gmail.com>2014-05-29 08:53:25 +0200
committerTim Graham <timograham@gmail.com>2014-05-30 08:05:43 -0400
commitb266392b638c188daf3621e7f919cc12d65a4e2a (patch)
tree41a473ab76fcd2c2de2755de22927bde01fa374d /docs
parent16d037c4f06104670b88989daa76b05a2f10fd85 (diff)
[1.7.x] Fixed #22710 -- Documented aggregation behavior for empty QuerySets.
Thanks matklad for the report. Backport of 7c6e96ec1f from master
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 55d697ffcf..2cc05e6a67 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -2659,6 +2659,12 @@ aggregate functions, see
aggregation on date/time fields in SQLite will raise
``NotImplementedError``.
+.. 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.
+
Avg
~~~