mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Corrected Aggregate docs to reflect that it accepts multiple expressions.
This commit is contained in:
parent
193c109327
commit
9a7d336c38
@ -373,7 +373,7 @@ some complex computations::
|
|||||||
|
|
||||||
The ``Aggregate`` API is as follows:
|
The ``Aggregate`` API is as follows:
|
||||||
|
|
||||||
.. class:: Aggregate(expression, output_field=None, filter=None, **extra)
|
.. class:: Aggregate(*expressions, output_field=None, filter=None, **extra)
|
||||||
|
|
||||||
.. attribute:: template
|
.. attribute:: template
|
||||||
|
|
||||||
@ -392,9 +392,9 @@ The ``Aggregate`` API is as follows:
|
|||||||
Defaults to ``True`` since most aggregate functions can be used as the
|
Defaults to ``True`` since most aggregate functions can be used as the
|
||||||
source expression in :class:`~django.db.models.expressions.Window`.
|
source expression in :class:`~django.db.models.expressions.Window`.
|
||||||
|
|
||||||
The ``expression`` argument can be the name of a field on the model, or another
|
The ``expressions`` positional arguments can include expressions or the names
|
||||||
expression. It will be converted to a string and used as the ``expressions``
|
of model fields. They will be converted to a string and used as the
|
||||||
placeholder within the ``template``.
|
``expressions`` placeholder within the ``template``.
|
||||||
|
|
||||||
The ``output_field`` argument requires a model field instance, like
|
The ``output_field`` argument requires a model field instance, like
|
||||||
``IntegerField()`` or ``BooleanField()``, into which Django will load the value
|
``IntegerField()`` or ``BooleanField()``, into which Django will load the value
|
||||||
|
@ -3297,10 +3297,10 @@ documentation to learn how to create your aggregates.
|
|||||||
|
|
||||||
All aggregates have the following parameters in common:
|
All aggregates have the following parameters in common:
|
||||||
|
|
||||||
``expression``
|
``expressions``
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
A string that references a field on the model, or a :doc:`query expression
|
Strings that reference fields on the model, or :doc:`query expressions
|
||||||
</ref/models/expressions>`.
|
</ref/models/expressions>`.
|
||||||
|
|
||||||
``output_field``
|
``output_field``
|
||||||
|
Loading…
Reference in New Issue
Block a user