diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-02-11 14:05:49 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-02-12 18:58:53 -0500 |
commit | 1d2b49bc991ca866fd71da3ccfbcde5093482512 (patch) | |
tree | 45d83e2a1ae0b4356670f2600e8f3b34d0776911 /lib/sqlalchemy/orm/context.py | |
parent | 4aa0c7ae76894048c5c30c89c403c7cbf5d844ff (diff) | |
download | sqlalchemy-1d2b49bc991ca866fd71da3ccfbcde5093482512.tar.gz |
Further refine labeling for renamed columns
Forked from I22f6cf0f0b3360e55299cdcb2452cead2b2458ea
we are attempting to decide the case for columns mapped
under a different name. since the .key feature of
Column seems to support this fully, see if an annotation
can be used to indicate an effective .key for a column.
The effective change is that the labeling of column expressions
in rows has been improved to retain the original name of the ORM
attribute even if used in a subquery.
References: #5933
Change-Id: If251f556f7d723f50d349f765f1690d6c679d2ef
Diffstat (limited to 'lib/sqlalchemy/orm/context.py')
-rw-r--r-- | lib/sqlalchemy/orm/context.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py index 621ed826c..fa192a17e 100644 --- a/lib/sqlalchemy/orm/context.py +++ b/lib/sqlalchemy/orm/context.py @@ -2619,12 +2619,12 @@ class _ORMColumnEntity(_ColumnEntity): _entity = parententity - # an AliasedClass won't have orm_key in the annotations for + # an AliasedClass won't have proxy_key in the annotations for # a column if it was acquired using the class' adapter directly, # such as using AliasedInsp._adapt_element(). this occurs # within internal loaders. - orm_key = annotations.get("orm_key", None) + orm_key = annotations.get("proxy_key", None) if orm_key: self.expr = getattr(_entity.entity, orm_key) else: |