Implemented used_length spool sort

This commit is contained in:
Donkie committed 2024-05-15 20:18:24 +02:00
1 parent 51c3b46f1f
commit c4693d3f34
2 files changed
+8

No files matched your search

+6
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)
@@ -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",