From 0bf04029dcdd912a1e5a4cdac1cccf14b60b3ec9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 24 Mar 2021 12:15:53 -0400 Subject: Support __visit_name__ on PropComparator to work in cloning Repaired support so that the :meth:`_sql.Select.params` method can work correctly with a :class:`_sql.Select` object that includes joins across ORM relationship structures, which is a new feature in 1.4. Fixes: #6124 Change-Id: Ia92fc33c3acbe66910e9e3bf00af9100de19b2b8 --- lib/sqlalchemy/orm/attributes.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqlalchemy/orm/attributes.py') diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index 2e48695f5..610ee2726 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -85,6 +85,10 @@ class QueryableAttribute( is_attribute = True + # PropComparator has a __visit_name__ to participate within + # traversals. Disambiguate the attribute vs. a comparator. + __visit_name__ = "orm_instrumented_attribute" + def __init__( self, class_, -- cgit v1.2.1