On Friday 04 January 2008 18:54:29 Alexandre da Silva wrote: > Hello all, > > is there any way to access class related by an relationship? > > sample: > > # Table definition ommited > > class Person(object): > pass > > class Address(object): > pass > > mapper(Person, person_table, > properties=dict( > address=relation(Address, uselist=False) > ) > ) > > > > now I want to access the Address class (and/or address_table) > through a Person object, > > any sugestion?
Person.address._get_target_class() Person.address.mapper.class_ and eventualy the table from the above mapper.local_table; see what kind of tables the mapper keeps. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---