Changes between Version 1 and Version 2 of Ticket #33403


Ignore:
Timestamp:
Jan 1, 2022, 2:34:56 PM (3 years ago)
Author:
karyon
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33403 – Description

    v1 v2  
    1414will give you 400. (apparently that's the correct sum 200 multiplied by the number of books of that publisher)
    1515
    16 I understand that joins in annotates can produce incorrect results, akin to the one documented here: [https://docs.djangoproject.com/en/4.0/topics/db/aggregation/#combining-multiple-aggregations #combining-multiple-aggregations]. However, the docs there say only "Combining multiple aggregations with annotate() will yield the wrong results", and here I'm not combining multiple aggregations. Furthermore, [https://docs.djangoproject.com/en/4.0/topics/db/aggregation/#order-of-annotate-and-filter-clauses #order-of-annotate-and-filter-clauses] says "When an annotate() clause is applied to a query, the annotation is computed over the state of the query up to the point where the annotation is requested.", which further made me believe this should actually work.
    17 
    18 It seems that Sum also has an undocumented distinct parameter. When I applied that one, I got incorrect results as well, and I couldn't even tell how those were computed.
     16I understand that joins in annotates can produce incorrect results, akin to the one documented here: [https://docs.djangoproject.com/en/4.0/topics/db/aggregation/#combining-multiple-aggregations #combining-multiple-aggregations]. However, the docs there say only "Combining multiple aggregations with annotate() will yield the wrong results", and here I'm not combining multiple aggregations. Furthermore, [https://docs.djangoproject.com/en/4.0/topics/db/aggregation/#order-of-annotate-and-filter-clauses #order-of-annotate-and-filter-clauses] says "When an annotate() clause is applied to a query, the annotation is computed over the state of the query up to the point where the annotation is requested.", which further made me believe this should actually work.
Back to Top