taskmanagerapi-ttkjqk/app/db/base_class.py
Automated Action aeab17a8ea Implement Task Manager API with FastAPI and SQLite
- Set up project structure
- Created Task model with SQLAlchemy
- Implemented SQLite database connection
- Created Alembic migrations
- Added Task CRUD endpoints
- Added health endpoint
- Updated README with project details

generated with BackendIM... (backend.im)
2025-05-14 07:18:59 +00:00

14 lines
312 B
Python

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