#32618 closed Cleanup/optimization (fixed)
Aggregation documentation should mention conditional aggregation
| Reported by: | Simon Willison | Owned by: | Hasan Ramezani | 
|---|---|---|---|
| Component: | Documentation | Version: | 3.2 | 
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | yes | UI/UX: | no | 
Description
I couldn't find a reference to https://docs.djangoproject.com/en/3.1/ref/models/conditional-expressions/#conditional-aggregation anywhere on https://docs.djangoproject.com/en/3.1/topics/db/aggregation/
Change History (5)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
| Easy pickings: | set | 
|---|---|
| Needs documentation: | unset | 
| Triage Stage: | Unreviewed → Accepted | 
| Type: | Bug → Cleanup/optimization | 
There is also an example in the Cheat sheet. A small reference should be enough, e.g.
diff --git a/docs/topics/db/aggregation.txt b/docs/topics/db/aggregation.txt
index cc6310052a..2e882e2a1a 100644
--- a/docs/topics/db/aggregation.txt
+++ b/docs/topics/db/aggregation.txt
@@ -354,7 +354,7 @@ authors with a count of highly rated books::
     >>> Author.objects.annotate(num_books=Count('book'), highly_rated_books=highly_rated)
 
 Each ``Author`` in the result set will have the ``num_books`` and
-``highly_rated_books`` attributes.
+``highly_rated_books`` attributes. See also :ref:`conditional-aggregation`.
 
 .. admonition:: Choosing between ``filter`` and ``QuerySet.filter()``
What do you think?
comment:3 by , 5 years ago
| Has patch: | set | 
|---|---|
| Owner: | changed from to | 
| Status: | new → assigned | 
  Note:
 See   TracTickets
 for help on using tickets.
    
I found one mention here: https://docs.djangoproject.com/en/3.1/topics/db/aggregation/#filtering-on-annotations