Kaydet (Commit) 7c6e96ec authored tarafından Guillaume Pannatier's avatar Guillaume Pannatier Kaydeden (comit) Tim Graham

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

Thanks matklad for the report.
üst 9cbf7f25
......@@ -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
~~~
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment