Skip to content

Commit

Permalink
Corrected Aggregate docs to reflect that it accepts multiple expressi…
Browse files Browse the repository at this point in the history
…ons.
  • Loading branch information
charettes authored and timgraham committed Nov 27, 2018
1 parent 193c109 commit 9a7d336
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions docs/ref/models/expressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ some complex computations::

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

Expand All @@ -392,9 +392,9 @@ The ``Aggregate`` API is as follows:
Defaults to ``True`` since most aggregate functions can be used as the
source expression in :class:`~django.db.models.expressions.Window`.

The ``expression`` argument can be the name of a field on the model, or another
expression. It will be converted to a string and used as the ``expressions``
placeholder within the ``template``.
The ``expressions`` positional arguments can include expressions or the names
of model fields. They will be converted to a string and used as the
``expressions`` placeholder within the ``template``.

The ``output_field`` argument requires a model field instance, like
``IntegerField()`` or ``BooleanField()``, into which Django will load the value
Expand Down
6 changes: 3 additions & 3 deletions docs/ref/models/querysets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3297,10 +3297,10 @@ documentation to learn how to create your aggregates.

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>`.

``output_field``
Expand Down

0 comments on commit 9a7d336

Please sign in to comment.