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.

123456789101112131415161718192021222324
  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. class Config:
  19. orm_mode = True