You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

14 line
564 B

  1. from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
  2. from sqlalchemy.orm import relationship
  3. from db.base import Base
  4. class MaintenanceJob(Base):
  5. Id = Column(Integer, primary_key=True, index=True)
  6. # a list of weak entities of class CarPart
  7. CarParts = relationship("CarPart", back_populates="parent")
  8. CreatedBy = relationship("User", back_populates="maintenanceJobs")
  9. Description = Column(String, nullable=False)
  10. Date = Column(DateTime, nullable=False)
  11. MaintenanceWorker = Column(ForeignKey("user.Id"), nullable=False)