Flask application skeleton with SQLAlchemy models for courses (including per-course settings), students, enrollments, opt-outs, and calls; the weighted and cycle selection logic ported from the manual coldcall scripts; alembic migrations; and a pytest suite covering selection behavior and the model query helpers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
15 lines
308 B
Python
15 lines
308 B
Python
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import DeclarativeBase, sessionmaker
|
|
|
|
|
|
class Base(DeclarativeBase):
|
|
pass
|
|
|
|
|
|
def make_engine(url, echo=False):
|
|
return create_engine(url, echo=echo)
|
|
|
|
|
|
def make_session_factory(engine):
|
|
return sessionmaker(bind=engine, expire_on_commit=False)
|