#31880: QuerySet.aggregate() mixes annotated fields names. -------------------------------------+------------------------------------- Reporter: Thodoris | Owner: David Sotiropoulos | Wobrock Type: Bug | Status: assigned Component: Database layer | Version: 3.1 (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by David Wobrock):
* has_patch: 0 => 1 Comment: Hi, thanks for taking the time diving into the issue. I agree that the expected behaviour is not obvious. My reflection why it could be supported was that: * it is possible since the aliases are used in two different queries (the outer and the inner) in the case of an aggregation * ''You can always use different aliases.'' it's true, but with a system that automatically generates QuerySets it might not be easy to "just use different aliases". However, let's go with an error, I agree that it adds complexity for not a lot of added value. There is a fair chance that the first patch missed edge cases. I pushed a new patch: https://github.com/django/django/pull/13431 Happy to hear what you think about this one :) -- Ticket URL: <https://code.djangoproject.com/ticket/31880#comment:8> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.836a555374bf4d4c8569876cfe924bfa%40djangoproject.com.