Corrected example of redundant all() in docs.

This commit is contained in:
Dhanush 2022-09-09 17:04:14 +05:30 committed by GitHub
parent 32797e7fbf
commit 6df9398cce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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::