0
직원이 0 또는 1 부모, 계열사 대표를 가질 수 있다면SQLAlchemy의 관계 : 하나 이상의 자기 참조 열
class Employee(Base):
__tablename__ = "employee"
# Columns
id = Column(Integer, primary_key=True, autoincrement=True)
representative_id = Column(Integer, ForeignKey('employee.id'))
parent_id = Column(Integer, ForeignKey('employee.id'))
affiliate_id = Column(Integer, ForeignKey('employee.id'))
# Relatonships
representative = relationship("Employee", ????)
parent = relationship("Employee", ????)
affiliate = relationship("Employee", ????)
어떻게 올바른 방법으로 관계를 구성 할 수 SQLAlchemy의 객체가있다? 이 세 가지가 다른 것임을 알고 계십니까? - DB MySQL의