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)