
- Set up project structure with app modules - Configure SQLite database connection - Set up Alembic for database migrations - Implement Item model with CRUD operations - Create API endpoints for items management - Add health check endpoint - Add API documentation - Add comprehensive README
18 lines
413 B
Python
18 lines
413 B
Python
"""
|
|
Base class for database models.
|
|
"""
|
|
from typing import Any
|
|
|
|
from sqlalchemy.ext.declarative import as_declarative, declared_attr
|
|
|
|
|
|
@as_declarative()
|
|
class Base:
|
|
"""Base class for all database models."""
|
|
id: Any
|
|
__name__: str
|
|
|
|
@declared_attr
|
|
def __tablename__(cls) -> str:
|
|
"""Generate database table name automatically from the class name."""
|
|
return cls.__name__.lower() |