add filters for all routes

This commit is contained in:
2026-02-15 01:09:36 +01:00
parent f440cef59e
commit a7b83da149
22 changed files with 184 additions and 82 deletions

View File

@@ -1,7 +1,11 @@
from sqlmodel import Session, select
import src.models as models
def get_all(session: Session, names: list[str], types: list[str]) -> list[models.ProductorPublic]:
def get_all(
session: Session,
names: list[str],
types: list[str]
) -> list[models.ProductorPublic]:
statement = select(models.Productor)
if len(names) > 0:
statement = statement.where(models.Productor.name.in_(names))