Added support for finding empty vendor fields

This commit is contained in:
Donkie
2023-09-08 20:31:50 +02:00
parent 3b8db0b5f7
commit f47eacd2a9
3 changed files with 24 additions and 12 deletions

View File

@@ -12,7 +12,8 @@ from sqlalchemy.orm import contains_eager, joinedload
from spoolman.database import filament, models
from spoolman.database.utils import (
SortOrder,
add_where_clause,
add_where_clause_int,
add_where_clause_int_opt,
add_where_clause_str,
add_where_clause_str_opt,
parse_nested_field,
@@ -111,8 +112,8 @@ async def find(
.options(contains_eager(models.Spool.filament).contains_eager(models.Filament.vendor))
)
stmt = add_where_clause(stmt, models.Spool.filament_id, filament_id)
stmt = add_where_clause(stmt, models.Filament.vendor_id, vendor_id)
stmt = add_where_clause_int(stmt, models.Spool.filament_id, filament_id)
stmt = add_where_clause_int_opt(stmt, models.Filament.vendor_id, vendor_id)
stmt = add_where_clause_str(stmt, models.Vendor.name, vendor_name)
stmt = add_where_clause_str_opt(stmt, models.Filament.name, filament_name)
stmt = add_where_clause_str_opt(stmt, models.Filament.material, filament_material)