Automated Action 7e35149610 Create simple todo application with FastAPI and SQLite
- Set up FastAPI project structure with proper organization
- Create Todo model with SQLAlchemy ORM
- Set up Alembic for database migrations
- Create CRUD operations and API endpoints for todos
- Add health check endpoint
- Update README with comprehensive documentation

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

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