Added filament color code field

This commit is contained in:
Donkie
2023-06-01 19:56:24 +02:00
parent 27731974fd
commit 4e409f6bb6
8 changed files with 57 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ async def create(
comment: Optional[str] = None,
settings_extruder_temp: Optional[int] = None,
settings_bed_temp: Optional[int] = None,
color_hex: Optional[str] = None,
) -> models.Filament:
"""Add a new filament to the database."""
vendor_item: models.Vendor | None = None
@@ -45,6 +46,7 @@ async def create(
comment=comment,
settings_extruder_temp=settings_extruder_temp,
settings_bed_temp=settings_bed_temp,
color_hex=color_hex,
)
db.add(db_item)
await db.flush()

View File

@@ -41,6 +41,7 @@ class Filament(Base):
comment: Mapped[Optional[str]] = mapped_column(String(1024))
settings_extruder_temp: Mapped[Optional[int]] = mapped_column(comment="Overridden extruder temperature.")
settings_bed_temp: Mapped[Optional[int]] = mapped_column(comment="Overridden bed temperature.")
color_hex: Mapped[Optional[str]] = mapped_column(String(6))
class Spool(Base):