diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-03-24 12:15:53 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-03-24 14:14:04 -0400 |
| commit | 0bf04029dcdd912a1e5a4cdac1cccf14b60b3ec9 (patch) | |
| tree | 302a8448540699df53f6ea5d314f2f04fd57bb52 /lib/sqlalchemy | |
| parent | a22b4dfbc44c78cb4fce27c33cf74cf57878a3b1 (diff) | |
| download | sqlalchemy-0bf04029dcdd912a1e5a4cdac1cccf14b60b3ec9.tar.gz | |
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
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 4 | ||||
| -rw-r--r-- | lib/sqlalchemy/orm/interfaces.py | 2 |
2 files changed, 6 insertions, 0 deletions
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_, diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py index a660d7e1a..e2cc36999 100644 --- a/lib/sqlalchemy/orm/interfaces.py +++ b/lib/sqlalchemy/orm/interfaces.py @@ -393,6 +393,8 @@ class PropComparator(operators.ColumnOperators): __slots__ = "prop", "property", "_parententity", "_adapt_to_entity" + __visit_name__ = "orm_prop_comparator" + def __init__( self, prop, # type: MapperProperty |
