taskmanagerapi-ds43ff/app/db/base_class.py
Automated Action ba478ce2d3 Implement Task Manager API with FastAPI and SQLite
Create a full-featured task management API with the following components:
- RESTful CRUD operations for tasks
- Task status and priority management
- SQLite database with SQLAlchemy ORM
- Alembic migrations
- Health check endpoint
- Comprehensive API documentation
2025-05-30 22:50:55 +00:00

20 lines
381 B
Python

"""
SQLAlchemy base class for all models.
"""
from typing import Any
from sqlalchemy.ext.declarative import as_declarative, declared_attr
@as_declarative()
class Base:
"""
Base class for all models.
"""
id: Any
__name__: str
# Generate __tablename__ automatically
@declared_attr
def __tablename__(cls) -> str:
return cls.__name__.lower()