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.

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