diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2009-01-15 22:33:55 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2009-01-15 22:33:55 +0000 |
| commit | bf710bd005688e0d6615ec758124b0f914741b51 (patch) | |
| tree | bcf2929c0c1e4aa7eaa329137807beea94ca8469 /docs | |
| parent | d55b361ac4dc0fb291855ada46054565ab33636e (diff) | |
Fixed #10035 -- Corrected more typos in the aggregation docs. Thanks to Ivan Sagalaev for his eagle eyes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9753 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/db/aggregation.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/topics/db/aggregation.txt b/docs/topics/db/aggregation.txt index 15dcb41eb9..45eb16ddbf 100644 --- a/docs/topics/db/aggregation.txt +++ b/docs/topics/db/aggregation.txt @@ -268,14 +268,14 @@ the annotation is computed over all members of the group. For example, consider an author query that attempts to find out the average rating of books written by each author: - >>> Author.objects.annotate(average_rating=Avg('book_rating')) + >>> Author.objects.annotate(average_rating=Avg('book__rating')) This will return one result for each author in the database, annotate with their average book rating. However, the result will be slightly different if you use a ``values()`` clause:: - >>> Author.objects.values('name').annotate(average_rating=Avg('book_rating')) + >>> Author.objects.values('name').annotate(average_rating=Avg('book__rating')) In this example, the authors will be grouped by name, so you will only get an annotated result for each *unique* author name. This means if you have @@ -302,7 +302,7 @@ output. For example, if we reverse the order of the ``values()`` and ``annotate()`` clause from our previous example:: - >>> Author.objects.annotate(average_rating=Avg('book_rating')).values('name') + >>> Author.objects.annotate(average_rating=Avg('book__rating')).values('name') This will now yield one unique result for each author; however, only the author's name and the ``average_rating`` annotation will be returned |
