Skip to content

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

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

felixxm merged 2 commits into
django:masterfrom
charettes:ticket-30739

Conversation

@charettes

Copy link
Copy Markdown
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

felixxm commented Sep 2, 2019

Copy link
Copy Markdown
Member

@charettes Thanks 👍

@felixxm
felixxm merged commit 13a8884 into django:master Sep 2, 2019
davidgegiya added a commit to davidgegiya/agent-orchestrator that referenced this pull request Nov 9, 2026
Pin 999891bd80b3d02dd916731a7a239e1036174885 and its regression selectors for reproducible runs.

Source: django/django#11734
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