1class Parent(Base):
2 __tablename__ = 'parent'
3 id = Column(Integer, primary_key=True)
4 children = relationship("Child", back_populates="parent")
5
6class Child(Base):
7 __tablename__ = 'child'
8 id = Column(Integer, primary_key=True)
9 parent_id = Column(Integer, ForeignKey('parent.id'))
10 parent = relationship("Parent", back_populates="children")