
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
20 lines
381 B
Python
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() |