Spool page for NFC links, bridge address; vendor-first new spool form
CI / test (push) Successful in 2m29s
CI / image (push) Successful in 39s

- /s/<id> shows a spool: rest in Spoolman and CC2 Control, where it is,
  last booking, history, links to Spoolman and the tag generator.
- Setting "Adresse der Bridge"; the tag generator can put <address>/s/<id>
  on the tag, so an iPhone held to the roll opens that page.
- New spool: vendor and material chosen from Spoolman, the vendor's
  filaments offered, values taken from similar filaments, duplicates
  pointed out and never created twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GcEk5tkfFSYD6NTF66NkC
This commit is contained in:
Jonas MenzelandClaude Opus 5.5 committed 2026-10-25 21:52:23 +01:00
1 parent b37cd64909
commit 64ea91d107
10 files changed
+304 -49

No files matched your search

+8 -4
View File
@@ -121,10 +121,14 @@ def create(client: Spoolman, p: dict, location: str) -> tuple[list[dict], str]:
v = client.create_vendor(body)
created_parts.append(f"Hersteller {vendor}")
vendor = v["name"]
fbody = {k: val for k, val in p["filament"].items() if val is not None}
fbody["vendor_id"] = v["id"]
fil = client.create_filament(fbody)
created_parts.append(f"Filament {fil.get('name')}")
name = p["filament"]["name"].lower()
fil = next((f for f in client.filaments() if (f.get("vendor") or {}).get("id") == v["id"]
and (f.get("name") or "").strip().lower() == name), None)
if fil is None: # the same vendor and name again would only clutter Spoolman
fbody = {k: val for k, val in p["filament"].items() if val is not None}
fbody["vendor_id"] = v["id"]
fil = client.create_filament(fbody)
created_parts.append(f"Filament {fil.get('name')}")
spools = []
for _ in range(p["count"]):
body: dict = {"filament_id": fil["id"], "location": location}