Changes between Initial Version and Version 1 of Ticket #31377, comment 3
- Timestamp:
- Mar 18, 2020, 5:14:27 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #31377, comment 3
initial v1 3 3 We can't change the behavior at the `annotate()` level as it would be backward incompatible and require extra checks every time an additional table is joined. 4 4 5 What needs to be adjust is `sql.Query.set_group_by` to set `alias=None` if `alias is not None and alias in {... set of all column names of tables in alias_map ...}` .5 What needs to be adjust is `sql.Query.set_group_by` to set `alias=None` if `alias is not None and alias in {... set of all column names of tables in alias_map ...}` before calling `annotation.get_group_by_cols` 6 6 7 7 https://github.com/django/django/blob/fc0fa72ff4cdbf5861a366e31cb8bbacd44da22d/django/db/models/sql/query.py#L1943-L1945