diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-04-08 02:02:04 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-04-08 02:02:04 +0000 |
| commit | 9099a82064af90e1a53e7d0546fef6c820245723 (patch) | |
| tree | 68f606c8a580b1f576097ffc989b0a891f04d7fc /lib/sqlalchemy | |
| parent | f657705bfc654756757686695b348c52225ecc04 (diff) | |
| parent | f2521f15809f5ad004be7470c41b73789b082ed2 (diff) | |
| download | sqlalchemy-9099a82064af90e1a53e7d0546fef6c820245723.tar.gz | |
Merge "convert subqueryload paths for multilevel"
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/strategies.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py index 822f7b96b..824df040a 100644 --- a/lib/sqlalchemy/orm/strategies.py +++ b/lib/sqlalchemy/orm/strategies.py @@ -16,6 +16,7 @@ from . import attributes from . import exc as orm_exc from . import interfaces from . import loading +from . import path_registry from . import properties from . import query from . import relationships @@ -1250,9 +1251,15 @@ class SubqueryLoader(PostLoader): # of the current state. this is for the specific case of the entity # is an AliasedClass against a subquery that's not otherwise going # to adapt + new_subq_path = current_compile_state._entities[ 0 ].entity_zero._path_registry[leftmost_prop] + additional = len(subq_path) - len(new_subq_path) + if additional: + new_subq_path += path_registry.PathRegistry.coerce( + subq_path[-additional:] + ) else: new_subq_path = given_subq_path |
