[Sqlalchemy-tickets] Issue #3423: AssociationProxy owning_class not set when accessed via mapper cl
Brought to you by:
zzzeek
|
From: babel <iss...@bi...> - 2015-05-15 21:51:09
|
New issue 3423: AssociationProxy owning_class not set when accessed via mapper class https://bitbucket.org/zzzeek/sqlalchemy/issue/3423/associationproxy-owning_class-not-set-when babel: This is using sqlalchemy 0.9.8 Assuming a declarative class called "MyClass" with an association proxy field call "my_field" >>> ap = MyClass.__mapper__.all_orm_descriptors['my_field'] >>> ap.owning_class None >>> ap = MyClass.my_field >>> ap.owning_class <class 'MyClass'> >>> ap = MyClass.__mapper__.all_orm_descriptors['my_field'] >>> ap.owning_class <class 'MyClass'> Without the owning_class set, most of the other properties will raise exceptions when trying to access them. This can be problematic when using the mapper class to procedurally access fields via the mapper. |