Skip to content
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 #30739 -- Fixed exclusion of multi-valued lookup against outer rhs. #11734

Merged
merged 2 commits into from Sep 2, 2019

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
2 participants