0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Fixed #22710 -- Documented aggregation behavior for empty QuerySets.

Thanks matklad for the report.
This commit is contained in:
Guillaume Pannatier 2014-05-29 08:53:25 +02:00 committed by Tim Graham
parent 9cbf7f25ef
commit 7c6e96ec1f

View File

@ -2631,6 +2631,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
~~~