--
Ticket URL: <https://code.djangoproject.com/ticket/32618>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Simon Willison):
I found one mention here:
https://docs.djangoproject.com/en/3.1/topics/db/aggregation/#filtering-on-
annotations
--
Ticket URL: <https://code.djangoproject.com/ticket/32618#comment:1>
* needs_docs: 1 => 0
* type: Bug => Cleanup/optimization
* easy: 0 => 1
* stage: Unreviewed => Accepted
Comment:
There is also an example in the
[https://docs.djangoproject.com/en/3.1/topics/db/aggregation/#cheat-sheet
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?
--
Ticket URL: <https://code.djangoproject.com/ticket/32618#comment:2>
* owner: nobody => Hasan Ramezani
* status: new => assigned
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/32618#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"1351f2ee163145df2cf5471eb3e57289f8853512" 1351f2e]:
{{{
#!CommitTicketReference repository=""
revision="1351f2ee163145df2cf5471eb3e57289f8853512"
Fixed #32618 -- Added link to conditional aggregation in aggregation topic
guide.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32618#comment:4>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"078bcd587dd0b4cc395713be02c38549f5fe65e3" 078bcd58]:
{{{
#!CommitTicketReference repository=""
revision="078bcd587dd0b4cc395713be02c38549f5fe65e3"
[3.2.x] Fixed #32618 -- Added link to conditional aggregation in
aggregation topic guide.
Backport of 1351f2ee163145df2cf5471eb3e57289f8853512 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32618#comment:5>