mirror of https://github.com/django/django.git
[1.6.x] Fixed #22710 -- Documented aggregation behavior for empty QuerySets.
Thanks matklad for the report.
Backport of 7c6e96ec1f
from master
This commit is contained in:
parent
3252e0654e
commit
4c358df66a
|
@ -2487,6 +2487,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
|
||||
~~~
|
||||
|
||||
|
|
Loading…
Reference in New Issue