[sqlalchemy] How to get ForeignKey from Relationship property

2018-04-10 Thread Tolstov Sergey
I use dynamic constructor for class. It works fine for instance who have not foreign keys. But when FK on another instance it cannot load them Example: class left (Base): id = sqlalchemy.Column(UUID, primary_key = True) def __getattr__(self, attribute): if attribute == 'rights': rig

Re: [sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-04-10 Thread Mike Bayer
On Tue, Apr 10, 2018 at 9:28 AM, Julien Cigar wrote: > Hello, > > I wondered if it is possible to use a class mapped against multiple > tables as a relationship() in another class? it is, there's examples at http://docs.sqlalchemy.org/en/latest/orm/join_conditions.html#relationship-to-non-primary

[sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-04-10 Thread Julien Cigar
Hello, I wondered if it is possible to use a class mapped against multiple tables as a relationship() in another class? something like: ### Content content_translation_join = sql.join( t_content, t_content_translation ) orm.mapper( ContentTranslation, content_translation_join, polymorphi