1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #28643 -- Changed Variance() to use NumericOutputFieldMixin.

Keeps precision instead of forcing DecimalField to FloatField.
This commit is contained in:
Nick Pope
2018-12-19 23:04:25 +00:00
committed by Tim Graham
parent e85afa5943
commit 6d4efa8e6a
4 changed files with 10 additions and 10 deletions

View File

@@ -3419,12 +3419,13 @@ by the aggregate.
``Variance``
~~~~~~~~~~~~
.. class:: Variance(expression, sample=False, filter=None, **extra)
.. class:: Variance(expression, output_field=None, sample=False, filter=None, **extra)
Returns the variance of the data in the provided expression.
* Default alias: ``<field>__variance``
* Return type: ``float``
* Return type: ``float`` if input is ``int``, otherwise same as input
field, or ``output_field`` if supplied
Has one optional argument:

View File

@@ -493,9 +493,9 @@ Miscellaneous
* :djadmin:`runserver` no longer supports `pyinotify` (replaced by Watchman).
* The :class:`~django.db.models.Avg` and :class:`~django.db.models.StdDev`
aggregate functions now return a ``Decimal`` instead of a ``float`` when the
input is ``Decimal``.
* The :class:`~django.db.models.Avg`, :class:`~django.db.models.StdDev`, and
:class:`~django.db.models.Variance` aggregate functions now return a
``Decimal`` instead of a ``float`` when the input is ``Decimal``.
.. _deprecated-features-2.2: