summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r--lib/sqlalchemy/orm/util.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index 0cd5b0594..f17f675f4 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -366,7 +366,18 @@ def _orm_annotate(element, exclude=None):
"""
return sql_util._deep_annotate(element, {'_orm_adapt':True}, exclude)
-_orm_deannotate = sql_util._deep_deannotate
+def _orm_deannotate(element):
+ """Remove annotations that link a column to a particular mapping.
+
+ Note this doesn't affect "remote" and "foreign" annotations
+ passed by the :func:`.orm.foreign` and :func:`.orm.remote`
+ annotators.
+
+ """
+
+ return sql_util._deep_deannotate(element,
+ values=("_orm_adapt", "parententity")
+ )
class _ORMJoin(expression.Join):
"""Extend Join to support ORM constructs as input."""