
- Set up FastAPI application structure - Implemented SQLite database integration with SQLAlchemy - Added Alembic migrations for database versioning - Created bet model and API endpoints for CRUD operations - Added comprehensive README with setup and usage instructions - Added health check endpoint and CORS support
21 lines
544 B
Python
21 lines
544 B
Python
from typing import Any
|
|
|
|
from sqlalchemy.ext.declarative import as_declarative, declared_attr
|
|
|
|
|
|
@as_declarative()
|
|
class Base:
|
|
"""
|
|
Base class for all SQLAlchemy models.
|
|
|
|
Provides common functionality for all models, including:
|
|
- Auto-generating table names based on class name
|
|
- Any future common model functionality can be added here
|
|
"""
|
|
id: Any
|
|
__name__: str
|
|
|
|
# Generate tablename automatically from class name
|
|
@declared_attr
|
|
def __tablename__(cls) -> str:
|
|
return cls.__name__.lower() |