Automated Action 68392c171a Add complete FastAPI todo app with CRUD operations
- Implement Todo model with SQLAlchemy
- Create Pydantic schemas for request/response validation
- Add complete CRUD API endpoints (/api/v1/todos)
- Include proper error handling and HTTP status codes
- Set up proper project structure with organized modules
- All code linted and formatted with ruff
2025-06-20 23:26:54 +00:00

28 lines
519 B
Python

from datetime import datetime
from typing import Optional
from pydantic import BaseModel
class TodoBase(BaseModel):
title: str
description: Optional[str] = None
completed: bool = False
class TodoCreate(TodoBase):
pass
class TodoUpdate(BaseModel):
title: Optional[str] = None
description: Optional[str] = None
completed: Optional[bool] = None
class TodoResponse(TodoBase):
id: int
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True