Is there a way to determine if a relationship property on a model class is
a backref?
For instance I have the model:
class Department(Base):
department_id = Column(Int(), primary_key=True)
class Employee(Base):
employee_id = Column(Int(), primary_key=True)
department_id = Column(Int(), ForeignKey(Department.deptartment_id),
nullable=False)
department = relationship(Department, backref='employees')
I'm looping through the attributes of each table and for each attribute
that has a relationship property I want to determine whether the
relationship constructor was called on the current table or not. So for
Department.employees it would be False because the relationship was defined
as a backref from another table. Is there a method/technique to accomplish
this?
Thanks,
Jason
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/d7to24Qzxe4J.
To post to this group, send email to [email protected].
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.