
- Implemented CRUD operations for manga, authors, publishers, and genres - Added search and filtering functionality - Set up SQLAlchemy ORM with SQLite database - Configured Alembic for database migrations - Implemented logging with Loguru - Added comprehensive API documentation - Set up error handling and validation - Added ruff for linting and formatting
15 lines
327 B
Python
15 lines
327 B
Python
from typing import Any
|
|
|
|
from sqlalchemy.ext.declarative import declared_attr
|
|
from sqlalchemy.orm import DeclarativeBase
|
|
|
|
|
|
class Base(DeclarativeBase):
|
|
id: Any
|
|
__name__: str
|
|
|
|
# Generate __tablename__ automatically
|
|
@declared_attr.directive
|
|
def __tablename__(self) -> str:
|
|
return self.__name__.lower()
|