mirror of
				https://github.com/django/django.git
				synced 2025-10-26 07:06:08 +00:00 
			
		
		
		
	[5.2.x] Corrected aggregation example in docs/ref/models/querysets.txt.
Backport of 3235e76eb5 from main.
			
			
This commit is contained in:
		
				
					committed by
					
						 Sarah Boyce
						Sarah Boyce
					
				
			
			
				
	
			
			
			
						parent
						
							91971013a1
						
					
				
				
					commit
					fa2adc383f
				
			| @@ -2804,16 +2804,16 @@ number of authors that have contributed blog entries: | |||||||
| .. code-block:: pycon | .. code-block:: pycon | ||||||
|  |  | ||||||
|     >>> from django.db.models import Count |     >>> from django.db.models import Count | ||||||
|     >>> Blog.objects.aggregate(Count("entry")) |     >>> Blog.objects.aggregate(Count("entry__authors")) | ||||||
|     {'entry__count': 16} |     {'entry__authors__count': 16} | ||||||
|  |  | ||||||
| By using a keyword argument to specify the aggregate function, you can | 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: | ||||||
|  |  | ||||||
| .. code-block:: pycon | .. code-block:: pycon | ||||||
|  |  | ||||||
|     >>> Blog.objects.aggregate(number_of_entries=Count("entry")) |     >>> Blog.objects.aggregate(number_of_authors=Count("entry__authors")) | ||||||
|     {'number_of_entries': 16} |     {'number_of_authors': 16} | ||||||
|  |  | ||||||
| For an in-depth discussion of aggregation, see :doc:`the topic guide on | For an in-depth discussion of aggregation, see :doc:`the topic guide on | ||||||
| Aggregation </topics/db/aggregation>`. | Aggregation </topics/db/aggregation>`. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user