taskmanagerapi-kwhxl0/app/db/base_class.py
Automated Action 7658939790 Create Task Manager API with FastAPI and SQLite
- Set up project structure and dependencies
- Create task model and schema
- Implement Alembic migrations
- Add CRUD API endpoints for task management
- Add health endpoint with database connectivity check
- Add comprehensive error handling
- Add tests for API endpoints
- Update README with API documentation
2025-06-04 22:52:31 +00:00

13 lines
316 B
Python

from typing import Any
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import as_declarative
@as_declarative()
class Base:
id: Any
__name__: str
# Generate __tablename__ automatically
@declared_attr
def __tablename__(cls) -> str:
return cls.__name__.lower()