18 lines
370 B
Python
18 lines
370 B
Python
from pydantic import BaseModel, Field
|
|
from datetime import date
|
|
|
|
class TodoCreate(BaseModel):
|
|
title: str = Field(..., max_length=255)
|
|
description: str
|
|
due_date: date
|
|
status: str = "pending"
|
|
|
|
class TodoResponse(BaseModel):
|
|
id: int
|
|
title: str
|
|
description: str
|
|
due_date: date
|
|
status: str
|
|
|
|
class Config:
|
|
from_attributes = True |