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.

1234567891011121314151617181920212223
  1. # Postgres table model for vehicles
  2. from sqlalchemy import (
  3. Column,
  4. Integer,
  5. String,
  6. ARRAY,
  7. )
  8. from sqlalchemy.orm import relationship
  9. from db.base import Base
  10. class Vehicle(Base):
  11. Id = Column(Integer, primary_key=True, index=True)
  12. Model = Column(String, nullable=False)
  13. Year = Column(Integer, nullable=False)
  14. LicensePlate = Column(String, nullable=False)
  15. CurrentLocation = Column(ARRAY(String), nullable=True)
  16. Fuel = Column(Integer, nullable=False)
  17. Mileage = Column(Integer, nullable=False)
  18. Status = Column(String, nullable=False)
  19. Capacity = Column(Integer, nullable=False)
  20. MaintenanceNotes = Column(ARRAY(String), nullable=True)
  21. driver = relationship("User", back_populates="vehicle")