Automated Action 6d123e4b89 Create simple todo app with FastAPI and SQLite
- Set up project structure
- Create database models with SQLAlchemy
- Add Alembic migrations
- Implement CRUD API endpoints
- Update README with documentation

generated with BackendIM... (backend.im)
2025-05-14 01:42:06 +00:00

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