Explorar o código

Corrected example of redundant all() in docs.

Dhanush %!s(int64=2) %!d(string=hai) anos
pai
achega
6df9398cce
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      docs/topics/db/aggregation.txt

+ 1 - 1
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::