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