add filters for all routes
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user