[2.2.x] Fixed #30347 -- Fixed typo in docs/topics/db/aggregation.txt.

Backport of ba72606760 from master
This commit is contained in:
Daniel Musketa 2019-04-13 12:35:31 +02:00 committed by Mariusz Felisiak
parent bfe279293c
commit f5c1d02f13
1 changed files with 2 additions and 2 deletions

View File

@ -354,8 +354,8 @@ If you need two annotations with two separate filters you can use the
``filter`` argument with any aggregate. For example, to generate a list of ``filter`` argument with any aggregate. For example, to generate a list of
authors with a count of highly rated books:: authors with a count of highly rated books::
>>> highly_rated = Count('books', filter=Q(books__rating__gte=7)) >>> highly_rated = Count('book', filter=Q(book__rating__gte=7))
>>> Author.objects.annotate(num_books=Count('books'), highly_rated_books=highly_rated) >>> Author.objects.annotate(num_books=Count('book'), highly_rated_books=highly_rated)
Each ``Author`` in the result set will have the ``num_books`` and Each ``Author`` in the result set will have the ``num_books`` and
``highly_rated_books`` attributes. ``highly_rated_books`` attributes.