Automated Action 168878cd6f Create Simple Todo Application with FastAPI and SQLite
- Set up project structure and dependencies
- Implement Todo model with SQLAlchemy
- Configure SQLite database connection
- Create Alembic migration scripts
- Implement RESTful API endpoints for CRUD operations
- Add health check endpoint
- Update README with documentation

generated with BackendIM... (backend.im)
2025-05-13 02:14:09 +00:00

27 lines
616 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 to return to client
class TodoResponse(TodoBase):
id: int
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True