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.

drivetask.py 682 B

1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1234567891011121314151617181920212223242526
  1. from pydantic import BaseModel, Field
  2. from datetime import datetime
  3. from schemas.user import ShowDriver
  4. from typing import Optional
  5. class CreateTask(BaseModel):
  6. DriverId: int = Field()
  7. Description: str = Field(..., min_length=3, max_length=200)
  8. StartLocation: tuple[str, str] = Field(...)
  9. EndLocation: tuple[str, str] = Field(...)
  10. class ShowTask(BaseModel):
  11. Id: int
  12. Driver: Optional[ShowDriver]
  13. Description: str
  14. Status: str
  15. StartLocation: tuple[str, str]
  16. EndLocation: tuple[str, str]
  17. StartDateTime: Optional[datetime]
  18. DistanceCovered: Optional[float]
  19. EndDateTime: Optional[datetime]
  20. class Config:
  21. orm_mode = True