New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #31880 -- Made QuerySet.aggregate() raise FieldError when aggregating over aggregation aliases. #13431
Conversation
95b2de7
to
edbd024
Compare
@jacobtylerwalls proposed the same solution to fix ticket-31679, see #13273. My initial response was that it's too restrictive. I was thinking about checking that an aggregation overrides and uses the same aliases 🤔. If it's not feasible or it's too complicated then I'm fine with this patch but we should add a backward incompatible note. |
edbd024
to
6ad21f3
Compare
Hi @felixxm This should be less restrictive and still allow currently working QuerySets like What do you think about this approach? 🤔 |
6ad21f3
to
cb177f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@David-Wobrock Looks good, thanks 👍
6922c59
to
b0acc73
Compare
@felixxm Merged the suggestions into one commit, thanks! |
…gating over aggregation aliases.
b0acc73
to
058747b
Compare
@David-Wobrock Thanks 👍 |
Ticket: https://code.djangoproject.com/ticket/31880
(First implementation: #13390)
Suggested patch for the discussion https://code.djangoproject.com/ticket/31880#comment:7