[WIP] front api exchanges

This commit is contained in:
2026-02-11 00:53:40 +01:00
parent feea610d09
commit 3b2b36839f
19 changed files with 694 additions and 32 deletions

View File

@@ -1,8 +1,16 @@
from sqlmodel import Session, select
import src.models as models
def get_all(session: Session) -> list[models.FormPublic]:
def get_all(
session: Session,
seasons: list[str],
productors: list[str]
) -> list[models.FormPublic]:
statement = select(models.Form)
if len(seasons) > 0:
statement = statement.where(models.Form.season.in_(seasons))
if len(productors) > 0:
statement = statement.join(models.Productor).where(models.Productor.name.in_(productors))
return session.exec(statement).all()
def get_one(session: Session, form_id: int) -> models.FormPublic: