mirror of
https://github.com/django/django.git
synced 2025-02-28 19:44:35 +00:00
[4.2.x] Fixed typo in docs/ref/models/querysets.txt.
Removed assignment in example for Blog annotation to match shown result. Backport of addbc90049083f1d5f7ac138ed00111b71a75233 from main
This commit is contained in:
parent
da92a971a0
commit
c99d935600
@ -2830,7 +2830,7 @@ number of authors that have contributed blog entries:
|
||||
.. code-block:: pycon
|
||||
|
||||
>>> from django.db.models import Count
|
||||
>>> q = Blog.objects.aggregate(Count("entry"))
|
||||
>>> Blog.objects.aggregate(Count("entry"))
|
||||
{'entry__count': 16}
|
||||
|
||||
By using a keyword argument to specify the aggregate function, you can
|
||||
@ -2838,7 +2838,7 @@ control the name of the aggregation value that is returned:
|
||||
|
||||
.. code-block:: pycon
|
||||
|
||||
>>> q = Blog.objects.aggregate(number_of_entries=Count("entry"))
|
||||
>>> Blog.objects.aggregate(number_of_entries=Count("entry"))
|
||||
{'number_of_entries': 16}
|
||||
|
||||
For an in-depth discussion of aggregation, see :doc:`the topic guide on
|
||||
|
Loading…
x
Reference in New Issue
Block a user