add products

This commit is contained in:
Julien Aldon
2026-02-12 17:39:53 +01:00
parent 025b78d5dd
commit 1a98957466
12 changed files with 129 additions and 75 deletions

View File

@@ -4,9 +4,9 @@ import src.models as models
def get_all(session: Session, names: list[str], types: list[str]) -> list[models.ProductorPublic]:
statement = select(models.Productor)
if len(names) > 0:
statement.where(models.Productor.name.in_(names))
statement = statement.where(models.Productor.name.in_(names))
if len(types) > 0:
statement.where(models.Productor.type.in_(types))
statement = statement.where(models.Productor.type.in_(types))
return session.exec(statement).all()
def get_one(session: Session, productor_id: int) -> models.ProductorPublic: