✅ Purpose

Stores a Service Worker file uploaded by the user. During deployment it becomes /worker.js on the domain.

🧩 Fields

  • name — unique name
  • worker — FileField (.js only, max 10 MB), stored using get_public_file_storage()
  • notes — optional, up to 300 chars
  • owner — FK to User
  • created_at, updated_at

🧠 Methods

  • __str__() → returns name

🔗 Relations

  • Landing.service_worker — each Landing must reference a ServiceWorker