sqlalchemy one to one foreign key

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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