Added empty spool weight as an option field for the vendor

This commit is contained in:
Matt Gerega
2024-03-26 20:35:50 -04:00
parent 83fd3073ec
commit e68f88da2a
4 changed files with 40 additions and 2 deletions

View File

@@ -235,6 +235,7 @@ async def use_weight_safe(db: AsyncSession, spool_id: int, weight: float) -> Non
db (AsyncSession): Database session
spool_id (int): Spool ID
weight (float): Filament weight to consume, in grams
"""
await db.execute(
sqlalchemy.update(models.Spool)
@@ -261,6 +262,7 @@ async def use_weight(db: AsyncSession, spool_id: int, weight: float) -> models.S
Returns:
models.Spool: Updated spool object
"""
await use_weight_safe(db, spool_id, weight)
@@ -288,6 +290,7 @@ async def use_length(db: AsyncSession, spool_id: int, length: float) -> models.S
Returns:
models.Spool: Updated spool object
"""
# Get filament diameter and density
result = await db.execute(