Add job creation with UUID, STL upload/library, search, job log, TZ, and CLAUDE.md
- PrintJob: job_uuid (UUID4), customer, logs relationship - JobLog model + migration 0004 (also includes job_logs table) - POST /jobs: upload STL or select from library, auto-logs 'Job created' - GET /jobs?q=: search by customer or filename across all statuses - app/stl.py: STL_UPLOAD_DIR helper (from env, default /data/stl) - docker-compose: named volume stl_files mounted at /data/stl - .env.install: added STL_UPLOAD_DIR and TZ=Europe/Berlin - CLAUDE.md: full project context for future sessions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
20
app/stl.py
Normal file
20
app/stl.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
_SUPPORTED = {".stl", ".3mf", ".gcode"}
|
||||
|
||||
|
||||
def get_stl_dir() -> Path:
|
||||
d = Path(os.environ.get("STL_UPLOAD_DIR", "/data/stl"))
|
||||
d.mkdir(parents=True, exist_ok=True)
|
||||
return d
|
||||
|
||||
|
||||
def list_stl_files() -> list[str]:
|
||||
try:
|
||||
return sorted(
|
||||
f.name for f in get_stl_dir().iterdir()
|
||||
if f.suffix.lower() in _SUPPORTED
|
||||
)
|
||||
except FileNotFoundError:
|
||||
return []
|
||||
Reference in New Issue
Block a user