From bb338b4a7f9576725073a38ad8a3a2ffc098d74c Mon Sep 17 00:00:00 2001 From: Sabron Date: Tue, 12 Nov 2024 10:16:54 +0700 Subject: [PATCH] update : 12.11.2024 10:16:54,34 --- apps/schedulers/tasks.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/schedulers/tasks.py b/apps/schedulers/tasks.py index 39b7e27..f074412 100644 --- a/apps/schedulers/tasks.py +++ b/apps/schedulers/tasks.py @@ -469,10 +469,15 @@ def load_sotekom(): SQL_QUERY = r'SELECT * FROM vw_INFO_DEVICE_TYPE WHERE id = ' + "'" + str(data[1]) + "'" cursor = mssql.executeSQL(conn,SQL_QUERY) - cursor_model = cursor.fetchall() - for model in cursor_model: - logging.message(f'model = {str(model)}') - + cursor_device_type = cursor.fetchall() + for device_type in cursor_device_type: + element.model_type = device_type[1] + SQL_QUERY = r'SELECT * FROM vvw_INFO_MODEL WHERE id = ' + "'" + str(data[1]) + "'" + cursor = mssql.executeSQL(conn,SQL_QUERY) + cursor_device_model = cursor.fetchall() + for device_model in cursor_device_model: + logging.message(f'model = {str(device_model)}') + #element.model_type = device_type[1] # element.time = row[0]+ timedelta(hours=7) # element.lat = 0 if row[2] is None else row[2] # element.lon = 0 if row[3] is None else row[3]