RE: [sqlalchemy] m2m introspection

2013-12-09 Thread Alexey Vihorev
] On Behalf Of Michael Bayer Sent: Sunday, December 08, 2013 10:47 PM To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] m2m introspection with modern sqlalchemy do this: from sqlalchemy import inspect for rel in inspect(MyClass).relationships: target_class = rel.mapper.class_

[sqlalchemy] m2m introspection

2013-12-08 Thread Alexey Vihorev
Hi again! I can do MyClass.iterate_properties()and check if a property is m2m relationship. But how can I find out which class it references? Thanks! -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving

Re: [sqlalchemy] m2m introspection

2013-12-08 Thread Michael Bayer
with modern sqlalchemy do this: from sqlalchemy import inspect for rel in inspect(MyClass).relationships: target_class = rel.mapper.class_ this stuff is all documented, though it involves familiarizing with a few basic constructs like Mapper and RelationshipProperty: