您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

25 行
609 B

  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