On Jan 4, 2008, at 11:54 AM, 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?
>

using the Person class directly:

Person.address.property.mapper.class_
Person.address.property.mapper.mapped_table



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to