diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2022-03-29 17:56:29 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-03-29 17:56:29 +0000 |
| commit | 470ca6d3fbac8e552cdd1020c9ce57127e059e4b (patch) | |
| tree | a13b85a434fcd83cce82a97d53868cf112ab0d33 /lib/sqlalchemy | |
| parent | dba480ebaf89c0b5ea787661583de9da3928920f (diff) | |
| parent | a55476fbdbc9b4e192a052b81dfe7e750d6241e4 (diff) | |
| download | sqlalchemy-470ca6d3fbac8e552cdd1020c9ce57127e059e4b.tar.gz | |
Merge "use annotated entity when adding secondary" into main
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/dynamic.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/dynamic.py b/lib/sqlalchemy/orm/dynamic.py index 52a6ec4b0..a3b02bb94 100644 --- a/lib/sqlalchemy/orm/dynamic.py +++ b/lib/sqlalchemy/orm/dynamic.py @@ -304,7 +304,10 @@ class AppenderMixin: # is in the FROM. So we purposely put the mapper selectable # in _from_obj[0] to ensure a user-defined join() later on # doesn't fail, and secondary is then in _from_obj[1]. - self._from_obj = (prop.mapper.selectable, prop.secondary) + + # note also, we are using the official ORM-annotated selectable + # from __clause_element__(), see #7868 + self._from_obj = (prop.mapper.__clause_element__(), prop.secondary) self._where_criteria = ( prop._with_parent(instance, alias_secondary=False), |
