Fixed #25355 -- Made two tweaks to docs/topics/db/aggregation.txt.

This commit is contained in:
Maarten 2015-09-05 12:35:58 +02:00 committed by Tim Graham
parent e687794f6b
commit fe58d96e50
1 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ In a hurry? Here's how to do common aggregate queries, assuming the models above
{'price_per_page': 0.4470664529184653} {'price_per_page': 0.4470664529184653}
# All the following queries involve traversing the Book<->Publisher # All the following queries involve traversing the Book<->Publisher
# many-to-many relationship backward # foreign key relationship backwards.
# Each publisher, each with a count of books as a "num_books" attribute. # Each publisher, each with a count of books as a "num_books" attribute.
>>> from django.db.models import Count >>> from django.db.models import Count
@ -242,7 +242,7 @@ price field of the book model to produce a minimum and maximum value.
The same rules apply to the ``aggregate()`` clause. If you wanted to The same rules apply to the ``aggregate()`` clause. If you wanted to
know the lowest and highest price of any book that is available for sale know the lowest and highest price of any book that is available for sale
in a store, you could use the aggregate:: in any of the stores, you could use the aggregate::
>>> Store.objects.aggregate(min_price=Min('books__price'), max_price=Max('books__price')) >>> Store.objects.aggregate(min_price=Min('books__price'), max_price=Max('books__price'))