mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #28643 -- Changed Avg() to use NumericOutputFieldMixin.
Keeps precision instead of forcing DecimalField to FloatField.
This commit is contained in:
parent
3d5e0f8394
commit
c690afb873
6 changed files with 23 additions and 21 deletions
|
@ -3336,14 +3336,14 @@ by the aggregate.
|
|||
``Avg``
|
||||
~~~~~~~
|
||||
|
||||
.. class:: Avg(expression, output_field=FloatField(), filter=None, **extra)
|
||||
.. class:: Avg(expression, output_field=None, filter=None, **extra)
|
||||
|
||||
Returns the mean value of the given expression, which must be numeric
|
||||
unless you specify a different ``output_field``.
|
||||
|
||||
* Default alias: ``<field>__avg``
|
||||
* Return type: ``float`` (or the type of whatever ``output_field`` is
|
||||
specified)
|
||||
* Return type: ``float`` if input is ``int``, otherwise same as input
|
||||
field, or ``output_field`` if supplied
|
||||
|
||||
``Count``
|
||||
~~~~~~~~~
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue