| 31 | |
| 32 | |
| 33 | class Employee(Base): |
| 34 | __tablename__ = "employees" |
| 35 | |
| 36 | id = Column(Integer, primary_key=True) |
| 37 | name = Column(String, nullable=False) |
| 38 | department_id = Column(Integer, ForeignKey("departments.id"), nullable=False) |
| 39 | |
| 40 | department = relationship("Department", back_populates="employees") |
| 41 | sales = relationship("Sale", back_populates="employee") |
| 42 | |
| 43 | |
| 44 | class Sale(Base): |
no outgoing calls
searching dependent graphs…