From 854aec4801d74fa00a6695b58c95257dadc1fc83 Mon Sep 17 00:00:00 2001 From: Botond Beres Date: Thu, 19 Oct 2017 17:36:55 +0100 Subject: [PATCH] [2.0.x] Fixed #28395 -- Doc'd that QuerySet.first() can affect aggregation queries. Backport of 95a14cfc47de5762ddb1400e6e5152f9e3172657 from master --- docs/ref/models/querysets.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 2e8b53debff..561d99c01ce 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -2169,7 +2169,8 @@ the direction is changed. Returns the first object matched by the queryset, or ``None`` if there is no matching object. If the ``QuerySet`` has no ordering defined, then the -queryset is automatically ordered by the primary key. +queryset is automatically ordered by the primary key. This can affect +aggregation results as described in :ref:`aggregation-ordering-interaction`. Example::