Clarified type of Window()'s partition_by and order_by arguments.

This commit is contained in:
David Sanders 2021-08-04 01:48:02 +10:00 committed by Mariusz Felisiak
parent c8d3cbdba8
commit ecf76cc1fb
1 changed files with 6 additions and 5 deletions

View File

@ -782,14 +782,15 @@ The ``expression`` argument is either a :ref:`window function
<window-functions>`, an :ref:`aggregate function <aggregation-functions>`, or <window-functions>`, an :ref:`aggregate function <aggregation-functions>`, or
an expression that's compatible in a window clause. an expression that's compatible in a window clause.
The ``partition_by`` argument is a list of expressions (column names should be The ``partition_by`` argument accepts an expression or a sequence of
wrapped in an ``F``-object) that control the partitioning of the rows. expressions (column names should be wrapped in an ``F``-object) that control
Partitioning narrows which rows are used to compute the result set. the partitioning of the rows. Partitioning narrows which rows are used to
compute the result set.
The ``output_field`` is specified either as an argument or by the expression. The ``output_field`` is specified either as an argument or by the expression.
The ``order_by`` argument accepts a sequence of expressions on which you can The ``order_by`` argument accepts an expression or a sequence of expressions on
call :meth:`~django.db.models.Expression.asc` and which you can call :meth:`~django.db.models.Expression.asc` and
:meth:`~django.db.models.Expression.desc`. The ordering controls the order in :meth:`~django.db.models.Expression.desc`. The ordering controls the order in
which the expression is applied. For example, if you sum over the rows in a which the expression is applied. For example, if you sum over the rows in a
partition, the first result is the value of the first row, the second is the partition, the first result is the value of the first row, the second is the