class Person(BaseTable):
__tablename__ = "persons"
id = Column(Integer, primary_key=True)
class F(BaseTable):
__tablename__ = "fabcs"
abc_id = Column(Integer, ForeignKey("persons.id"))
a = relationship('Person')
b = relationship('Person')
c = relationship('Person')
class F(BaseTable):
__tablename__ = "fabcs"
a_id = Column(Integer, ForeignKey("persons.id"))
b_id = Column(Integer, ForeignKey("persons.id"))
c_id = Column(Integer, ForeignKey("persons.id"))
a = relationship('Person', foreign_keys=[a_id])
b = relationship('Person', foreign_keys=[b_id])
c = relationship('Person', foreign_keys=[c_id])
class Parent(Base):
__tablename__ = 'parent'
id = Column(Integer, primary_key=True)
children = relationship("Child")
class Child(Base):
__tablename__ = 'child'
id = Column(Integer, primary_key=True)
parent_id = Column(Integer, ForeignKey('parent.id'))