diff options
author | Simon Charette <charette.s@gmail.com> | 2023-02-26 13:43:00 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-02-27 07:18:58 +0100 |
commit | c67ea79aa981ae82595d89f8018a41fcd842e7c9 (patch) | |
tree | 40c222b0e86796b2614e55e96a8898ca95500422 /django/db/models/expressions.py | |
parent | b15f162f252610e3b510ade465549769ab4356cf (diff) | |
download | django-c67ea79aa981ae82595d89f8018a41fcd842e7c9.tar.gz |
Fixed #34368 -- Made subquery raise NotSupportedError when referencing outer window expression.
Regression in f387d024fc75569d2a4a338bfda76cc2f328f627.
Co-authored-by: Jannis Vajen <jvajen@gmail.com>
Diffstat (limited to 'django/db/models/expressions.py')
-rw-r--r-- | django/db/models/expressions.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index 2d8a5c5919..d412e7657e 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -857,6 +857,11 @@ class ResolvedOuterRef(F): def resolve_expression(self, *args, **kwargs): col = super().resolve_expression(*args, **kwargs) + if col.contains_over_clause: + raise NotSupportedError( + f"Referencing outer query window expression is not supported: " + f"{self.name}." + ) # FIXME: Rename possibly_multivalued to multivalued and fix detection # for non-multivalued JOINs (e.g. foreign key fields). This should take # into account only many-to-many and one-to-many relationships. |