Automated Action b5638b4c86 Add Simple Todo Application with FastAPI and SQLite
- Create project structure with FastAPI setup
- Implement Todo model with SQLAlchemy
- Set up database migrations with Alembic
- Create CRUD API endpoints for Todo items
- Add health endpoint for application monitoring
- Update README with documentation

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

31 lines
678 B
Python

from pydantic import BaseModel
from datetime import datetime
from typing import Optional
# Shared properties
class TodoBase(BaseModel):
title: str
description: Optional[str] = None
completed: bool = False
# Properties to receive on creation
class TodoCreate(TodoBase):
pass
# Properties to receive on update
class TodoUpdate(TodoBase):
title: Optional[str] = None
completed: Optional[bool] = None
# Properties shared by models stored in DB
class TodoInDBBase(TodoBase):
id: int
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
# Properties to return to client
class Todo(TodoInDBBase):
pass