Spaces:
Sleeping
Sleeping
File size: 717 Bytes
34e9d7f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime
class Task(BaseModel):
id: Optional[int] = None
title: str = Field(..., min_length=1, max_length=100, description="Título da tarefa")
description: Optional[str] = Field(None, max_length=500, description="Descrição detalhada")
completed: bool = Field(default=False, description="Status de conclusão")
created_at: Optional[datetime] = None
class Config:
json_schema_extra = {
"example": {
"title": "Aprender FastAPI",
"description": "Completar o bootcamp de FastAPI com Docker",
"completed": False
}
} |