Automated Action a054c1c20d Add simple todo app with FastAPI and SQLite
- Created FastAPI application with CRUD endpoints for todos
- Set up SQLAlchemy with SQLite database
- Created database models and Pydantic schemas
- Added Alembic for database migrations
- Added health check endpoint
- Updated README with project information

generated with BackendIM... (backend.im)
2025-05-12 22:59:07 +00:00

24 lines
510 B
Python

from pydantic import BaseModel
from typing import Optional
from datetime import datetime
class TodoBase(BaseModel):
title: str
description: Optional[str] = None
completed: Optional[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: datetime
class Config:
orm_mode = True