Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clarified some documentation on the use of the aggregate() query modi…
…fier, following suggestions on IRC. Thanks to Tai Lee for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
freakboy3742 committed Feb 17, 2009
1 parent fd28d04 commit e83f81d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/ref/models/querysets.txt
Expand Up @@ -991,7 +991,7 @@ generated for them based upon the name of the aggregate function and
the model field that is being aggregated. the model field that is being aggregated.


For example, if you were manipulating blog entries, you may want to know For example, if you were manipulating blog entries, you may want to know
the average number of authors contributing to blog entries:: the number of authors that have contributed blog entries::


>>> q = Blog.objects.aggregate(Count('entry')) >>> q = Blog.objects.aggregate(Count('entry'))
{'entry__count': 16} {'entry__count': 16}
Expand All @@ -1000,7 +1000,7 @@ By using a keyword argument to specify the aggregate function, you can
control the name of the aggregation value that is returned:: control the name of the aggregation value that is returned::


>>> q = Blog.objects.aggregate(number_of_entries=Count('entry')) >>> q = Blog.objects.aggregate(number_of_entries=Count('entry'))
{'number_of_entries': 2.34} {'number_of_entries': 16}


For an in-depth discussion of aggregation, see :ref:`the topic guide on For an in-depth discussion of aggregation, see :ref:`the topic guide on
Aggregation <topics-db-aggregation>`. Aggregation <topics-db-aggregation>`.
Expand Down

0 comments on commit e83f81d

Please sign in to comment.