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:
+4
-3
@@ -63,6 +63,7 @@ def main(xlsx_path):
|
||||
machine_id = _sanitize_machine_id(str(int(row[2])))
|
||||
location_str = str(row[1]) if row[1] else '' # "Company - Address"
|
||||
customer_name = str(row[21]) if row[21] else '' # Customer
|
||||
is_disney = 1 if customer_name.strip().startswith('D-') else 0
|
||||
address = str(row[6]) if row[6] else ''
|
||||
city = str(row[5]) if row[5] else ''
|
||||
state = str(row[33]) if row[33] else ''
|
||||
@@ -136,10 +137,10 @@ def main(xlsx_path):
|
||||
cursor = conn.execute("""
|
||||
INSERT INTO assets
|
||||
(machine_id, name, serial_number, make, model, category,
|
||||
status, address, customer_id, created_at, updated_at, description)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), datetime('now'), ?)
|
||||
status, address, customer_id, is_disney, created_at, updated_at, description)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), datetime('now'), ?)
|
||||
""", (machine_id, name, serial, make, model, cat,
|
||||
status, full_address, customer_id,
|
||||
status, full_address, customer_id, is_disney,
|
||||
device + ' | Branch: ' + branch if branch else device))
|
||||
aid = cursor.lastrowid
|
||||
existing_assets[machine_id] = aid
|
||||
|
||||
Reference in New Issue
Block a user