[Django] #32618: Aggregation documentation should mention conditional aggregation

1 view
Skip to first unread message

Django

unread,
Apr 7, 2021, 11:45:05 PM4/7/21
to django-...@googlegroups.com
#32618: Aggregation documentation should mention conditional aggregation
------------------------------------------+------------------------
Reporter: Simon Willison | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 1 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
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/

--
Ticket URL: <https://code.djangoproject.com/ticket/32618>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 7, 2021, 11:46:09 PM4/7/21
to django-...@googlegroups.com
#32618: Aggregation documentation should mention conditional aggregation
--------------------------------+--------------------------------------

Reporter: Simon Willison | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 3.2
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

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>

Django

unread,
Apr 8, 2021, 12:13:10 AM4/8/21
to django-...@googlegroups.com
#32618: Aggregation documentation should mention conditional aggregation
--------------------------------------+------------------------------------

Reporter: Simon Willison | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* 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>

Django

unread,
Apr 9, 2021, 10:23:50 AM4/9/21
to django-...@googlegroups.com
#32618: Aggregation documentation should mention conditional aggregation
-------------------------------------+-------------------------------------
Reporter: Simon Willison | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 3.2

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* owner: nobody => Hasan Ramezani
* status: new => assigned
* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32618#comment:3>

Django

unread,
Apr 9, 2021, 3:35:24 PM4/9/21
to django-...@googlegroups.com
#32618: Aggregation documentation should mention conditional aggregation
-------------------------------------+-------------------------------------
Reporter: Simon Willison | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.2
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* 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>

Django

unread,
Apr 9, 2021, 3:36:30 PM4/9/21
to django-...@googlegroups.com
#32618: Aggregation documentation should mention conditional aggregation
-------------------------------------+-------------------------------------
Reporter: Simon Willison | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.2

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages