Added external ID fields to filaments and vendors

This commit is contained in:
Donkie
2024-05-12 19:31:12 +02:00
parent 36945f449d
commit 1e4c73138c
7 changed files with 69 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ async def create(
name: Optional[str] = None,
comment: Optional[str] = None,
empty_spool_weight: Optional[float] = None,
external_id: Optional[str] = None,
extra: Optional[dict[str, str]] = None,
) -> models.Vendor:
"""Add a new vendor to the database."""
@@ -28,6 +29,7 @@ async def create(
registered=datetime.utcnow().replace(microsecond=0),
comment=comment,
empty_spool_weight=empty_spool_weight,
external_id=external_id,
extra=[models.VendorField(key=k, value=v) for k, v in (extra or {}).items()],
)
db.add(vendor)