sqlalchemy one to one foreign key

Solutions on MaxInterview for sqlalchemy one to one foreign key by the best coders in the world

showing results for - "sqlalchemy one to one foreign key"
Niko
01 Apr 2019
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
similar questions
queries leading to this page
sqlalchemy one to one foreign key