- edited description
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.