Skip to content
/ django Public

Fixed #30739 -- Fixed exclusion of multi-valued lookup against outer rhs.#11734

Merged
felixxm merged 2 commits intodjango:masterfrom
charettes:ticket-30739
Sep 2, 2019
Merged

Fixed #30739 -- Fixed exclusion of multi-valued lookup against outer rhs.#11734
felixxm merged 2 commits intodjango:masterfrom
charettes:ticket-30739

Conversation

@charettes
Copy link
Member

No description provided.

@charettes charettes changed the title Fixed #30739 -- Handled exclusion of multi-valued lookups against an outer rhs. Fixed #30739 -- Handled exclusion of multi-valued lookups against outer rhs. Sep 1, 2019
@charettes charettes changed the title Fixed #30739 -- Handled exclusion of multi-valued lookups against outer rhs. Fixed #30739 -- Handled exclusion of multi-valued lookup against outer rhs. Sep 1, 2019
Expressions should never be prepared as other Lookup.get_prep_lookup
implementations hint at by returning early on the presence of the
resolve_expression attribute.

The previous solution was only handling lookups against related fields
pointing at AutoFields and would break for foreign keys to other fields.

It was also causing bidirectional coupling between model fields and
expressions which the method level import of OuterRef was a symptom of.
…rhs.

OuterRef right hand sides have to be nested, just like F rhs have to,
during the subquery pushdown split_exclude performs to ensure they are
resolved against the outer query aliases.
@felixxm felixxm changed the title Fixed #30739 -- Handled exclusion of multi-valued lookup against outer rhs. Fixed #30739 -- Fixed' exclusion of multi-valued lookup against outer rhs. Sep 2, 2019
@felixxm felixxm changed the title Fixed #30739 -- Fixed' exclusion of multi-valued lookup against outer rhs. Fixed #30739 -- Fixed exclusion of multi-valued lookup against outer rhs. Sep 2, 2019
@felixxm
Copy link
Member

felixxm commented Sep 2, 2019

@charettes Thanks 👍

@felixxm felixxm merged commit 13a8884 into django:master Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants