Automated Action d667651110 Create simple Todo app with FastAPI and SQLite
- Add CRUD operations for todos (create, read, update, delete)
- Implement SQLAlchemy models and schemas
- Set up Alembic for database migrations
- Add health endpoint and CORS configuration
- Include comprehensive API documentation
- Structure project with proper separation of concerns
2025-06-19 22:02:18 +00:00

28 lines
528 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 Todo(TodoBase):
id: int
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True