From 6df9398cce063874ae4d59db126d4adacb0fa8d3 Mon Sep 17 00:00:00 2001 From: Dhanush Date: Fri, 9 Sep 2022 17:04:14 +0530 Subject: [PATCH] Corrected example of redundant all() in docs. --- docs/topics/db/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/db/aggregation.txt b/docs/topics/db/aggregation.txt index 42be569cb4..d871c548e2 100644 --- a/docs/topics/db/aggregation.txt +++ b/docs/topics/db/aggregation.txt @@ -111,7 +111,7 @@ belong to this ``QuerySet``. This is done by appending an ``aggregate()`` clause onto the ``QuerySet``:: >>> from django.db.models import Avg - >>> Book.objects.aggregate(Avg('price')) + >>> Book.objects.all().aggregate(Avg('price')) {'price__avg': 34.35} The ``all()`` is redundant in this example, so this could be simplified to::