Implemented used_length spool sort

This commit is contained in:
Donkie
2024-05-15 20:18:24 +02:00
parent 51c3b46f1f
commit c4693d3f34
2 changed files with 8 additions and 0 deletions

View File

@@ -176,6 +176,12 @@ async def find( # noqa: C901
/ models.Filament.density
/ (models.Filament.diameter * models.Filament.diameter),
)
elif fieldstr == "used_length":
sorts.append(
models.Spool.used_weight
/ models.Filament.density
/ (models.Filament.diameter * models.Filament.diameter),
)
elif fieldstr == "filament.combined_name":
sorts.append(models.Vendor.name)
sorts.append(models.Filament.name)

View File

@@ -223,6 +223,8 @@ def test_find_all_spools_limit_asc_offset_outside_range(spools: Fixture): # noq
"filament_id",
"used_weight",
"remaining_weight",
"used_length",
"remaining_length",
"location",
"lot_nr",
"comment",