Automated Action af063c97fc Create Todo app with FastAPI and SQLite
- Set up project structure with FastAPI and SQLAlchemy
- Create Todo model with CRUD operations
- Implement database migrations with Alembic
- Add health endpoint and API documentation
- Create comprehensive README

generated with BackendIM... (backend.im)
2025-05-13 17:36:33 +00:00

28 lines
511 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: datetime
class Config:
from_attributes = True