16 lines
361 B
Python
16 lines
361 B
Python
from pydantic import BaseModel, Field
|
|
from datetime import datetime
|
|
|
|
class TodoCreate(BaseModel):
|
|
title: str = Field(..., max_length=255)
|
|
description: str | None = Field(None)
|
|
|
|
class TodoResponse(BaseModel):
|
|
id: int
|
|
title: str
|
|
description: str | None
|
|
status: str
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True |