add i18n, products, productors and forms as tables

This commit is contained in:
2026-02-12 00:30:28 +01:00
parent 1813e2893e
commit 025b78d5dd
43 changed files with 1623 additions and 527 deletions

View File

@@ -1,8 +1,12 @@
from sqlmodel import Session, select
import src.models as models
def get_all(session: Session) -> 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.where(models.Productor.name.in_(names))
if len(types) > 0:
statement.where(models.Productor.type.in_(types))
return session.exec(statement).all()
def get_one(session: Session, productor_id: int) -> models.ProductorPublic: