Automated Action af6c39316b Create simple FastAPI Todo app with SQLite
- Set up project structure with FastAPI app
- Create SQLite database models with SQLAlchemy
- Set up Alembic migrations
- Implement CRUD endpoints for todo items
- Add health check endpoint
- Update README with setup instructions

generated with BackendIM... (backend.im)
2025-05-13 15:51:44 +00:00

24 lines
532 B
Python

from pydantic import BaseModel
from datetime import datetime
from typing import Optional
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: Optional[datetime] = None
class Config:
from_attributes = True