feat: add is_disney column for reliable Disney/Non-Disney filtering

- Added is_disney INTEGER DEFAULT 0 column to assets table
- Backfilled 996 Disney assets based on D- customer prefix
- Server: is_disney in AssetCreate/AssetUpdate models, INSERT/UPDATE
- Server: disney_filter query param now uses is_disney column (no JOIN needed)
- import_cantaloupe.py: sets is_disney=1 when customer starts with D-
- import_machines.py: sets is_disney=1 when customer starts with D-
- disney_classify.py: sets is_disney=1 when classifying
- Frontend: new Location Type dropdown with Disney/Non-Disney toggle
  (replaces the __disney__/__non_disney__ park dropdown pseudo-options)
This commit is contained in:
2026-05-22 18:34:13 -04:00
parent 60dfd3434a
commit e8a918fc7b
5 changed files with 39 additions and 25 deletions
+4 -3
View File
@@ -141,17 +141,18 @@ def import_assets():
# Customer lookup
customer_id = customer_map.get(customer_name)
is_disney = 1 if customer_name.startswith('D-') else 0
try:
cursor = conn.execute("""
INSERT INTO assets
(machine_id, name, description, category, status,
make, model, serial_number, address, room,
customer_id)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
customer_id, is_disney)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""", (
machine_id, name, description, "Equipment", status,
make, model, serial, full_address, place,
customer_id,
customer_id, is_disney,
))
inserted += 1
except sqlite3.IntegrityError as e: