WRITELOOP

SQLALCHEMY ONE-TO-ONE RELATIONSHIP

2018 August 6

If you want a true one-to-one relationship, you also have to use the “uselist=False” in your relationship definition:

bar_id = Column(Integer, ForeignKey(Bar.id))
bar = relationship(Bar, uselist=False)

https://stackoverflow.com/questions/3464443/sqlalchemy-one-to-one-relationship-with-declarative/9611874#9611874