Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

maintenancejob.py 862 B

pirms 1 gada
pirms 1 gada
pirms 1 gada
1234567891011121314151617
  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. FinishedBy = relationship("User", back_populates="maintenanceJobs", foreign_keys="MaintenanceJob.MaintenanceWorker")
  9. VehicleID = Column(ForeignKey("vehicle.Id"), nullable=False)
  10. Vehicle = relationship("Vehicle", back_populates="maintenanceJobs")
  11. VehicleDriverId = Column(ForeignKey("user.Id"), nullable=False)
  12. Description = Column(String, nullable=False)
  13. Date = Column(DateTime, nullable=False)
  14. MaintenanceWorker = Column(ForeignKey("user.Id"), nullable=True)
  15. Status = Column(String, nullable=False)