Changes between Initial Version and Version 1 of Ticket #30158, comment 3


Ignore:
Timestamp:
Feb 5, 2019, 1:07:19 PM (5 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30158, comment 3

    initial v1  
    1 I suspect `Subquery.get_group_by_cols` needs to be adjusted to return an empty list. Since #30099 (2.2a1+ only) [https://github.com/django/django/blob/f021c110d02fd7ca32ae56f511b46e5d138b6c73/django/db/models/expressions.py#L334-L336 it returns] `[self]` but before this change [it returned all the filter conditions with a left hand side](https://github.com/django/django/blob/f021c110d02fd7ca32ae56f511b46e5d138b6c73/django/db/models/expressions.py#L1047-L1053) which is even worst.
     1I suspect `Subquery.get_group_by_cols` needs to be adjusted to return an empty list. Since #30099 (2.2a1+ only) [https://github.com/django/django/blob/f021c110d02fd7ca32ae56f511b46e5d138b6c73/django/db/models/expressions.py#L334-L336 it returns] `[self]` but before this change [https://github.com/django/django/blob/f021c110d02fd7ca32ae56f511b46e5d138b6c73/django/db/models/expressions.py#L1047-L1053 it returned all the filter conditions with a left hand side] which is even worst.
    22
    33Could you try subclassing `Subquery` and overriding `get_group_by_cols` to `return []`, use the subclass with your query, and see if it helps?
Back to Top