Automated Action 2204ae214d Create a simple Todo app with FastAPI and SQLite
- Set up project structure and FastAPI application
- Create Todo database model with SQLAlchemy
- Configure Alembic for database migrations
- Implement CRUD endpoints for managing Todo items
- Add health check endpoint
- Include comprehensive documentation in README.md
- Configure and apply Ruff linting
2025-05-19 13:36:18 +00:00

44 lines
797 B
Python

from datetime import datetime
from typing import Optional
from pydantic import BaseModel
class TodoBase(BaseModel):
"""Base schema for Todo items"""
title: str
description: Optional[str] = None
completed: bool = False
class TodoCreate(TodoBase):
"""Schema for creating a new Todo item"""
pass
class TodoUpdate(BaseModel):
"""Schema for updating a Todo item"""
title: Optional[str] = None
description: Optional[str] = None
completed: Optional[bool] = None
class TodoInDBBase(TodoBase):
"""Base schema for Todo items from the database"""
id: int
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
class Todo(TodoInDBBase):
"""Schema for Todo items returned from the API"""
pass