diff options
| author | Simon Charette <charette.s@gmail.com> | 2018-11-24 01:36:18 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-11-27 09:28:49 -0500 |
| commit | 5760e053758a181aafa913f7a5565d84432fa5b8 (patch) | |
| tree | 7239984be0a92adc46b0ba5436f5f6106f524055 | |
| parent | 0d4bbd3f3387e77fd86413e8fb6be655e524e7f1 (diff) | |
[2.1.x] Corrected Aggregate docs to reflect that it accepts multiple expressions.
Backport of 9a7d336c3866c5226ed11868be0234c7e2fa47fa from master.
| -rw-r--r-- | docs/ref/models/expressions.txt | 8 | ||||
| -rw-r--r-- | docs/ref/models/querysets.txt | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index ce19beeb28..4d7b52c4f4 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -372,7 +372,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 @@ -393,9 +393,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 diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 609a87097a..b98f3a340f 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -3244,10 +3244,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`` |
