Hi,

  I'd like to get programmatically the class to which a relation
  points. Suppose I have the following situation:

  class Project(Base):
     ...
     staff   = relation(User, secondary=project_manager)
     manager = relation(User, secondary=project_staff)

  Now I want to get User class starting from Project and 'staff'. 

  Project.__mapper__.get_property('manager')._get_target().class_

  seems to do that but the leading underscore in _get_target suggest it's
  private, so I wandererd if that's the best way...

  thanks in advance
  sandro
  *:-)


-- 
Sandro Dentella  *:-)
http://sqlkit.argolinux.org        SQLkit home page - PyGTK/python/sqlalchemy

--~--~---------~--~----~------------~-------~--~----~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to