Refs #27149 -- Moved subquery expression resolving to Query.

This makes Subquery a thin wrapper over Query and makes sure it respects
the Expression source expression API by accepting the same number of
expressions as it returns. Refs #30188.

It also makes OuterRef usable in Query without Subquery wrapping. This
should allow Query's internals to more easily perform subquery push downs
during split_exclude(). Refs #21703.
This commit is contained in:
Simon Charette 2019-03-06 01:05:55 -05:00 committed by Tim Graham
parent 96b6ad94d9
commit 3543129822
4 changed files with 52 additions and 57 deletions

View file

@ -402,7 +402,7 @@ class Queries1Tests(TestCase):
def test_avoid_infinite_loop_on_too_many_subqueries(self):
x = Tag.objects.filter(pk=1)
local_recursion_limit = 127
local_recursion_limit = 67
msg = 'Maximum recursion depth exceeded: too many subqueries.'
with self.assertRaisesMessage(RuntimeError, msg):
for i in range(local_recursion_limit * 2):