From 9622b90685de87ef273c63096111d4150bfb01aa Mon Sep 17 00:00:00 2001 From: ManuelW Date: Sat, 11 May 2024 09:52:44 +0200 Subject: [PATCH] DB config --- insertLoading.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/insertLoading.py b/insertLoading.py index cfa3d7f..816c61b 100644 --- a/insertLoading.py +++ b/insertLoading.py @@ -47,11 +47,11 @@ def updateLast(cursor): cursor.execute(sql) row = cursor.fetchone() - ins_id = row["id"] + ins_id = row[0] ## hole alle Fahrten nach letzter Ladung sql = ''' - SELECT * FROM bike_drives WHERE d_date >= 'row["l_date"]'; + SELECT d_total_distance, d_total_ascent, d_avg_speed FROM bike_drives WHERE d_date >= 'row[1]'; ''' cursor.execute(sql) rows = cursor.fetchall() @@ -63,9 +63,9 @@ def updateLast(cursor): for row in rows: fahrten += 1 - total_range += row["d_total_distance"] - total_ascent += row["d_total_ascent"] - avg_speed += row["d_avg_speed"] + total_range += row[0] + total_ascent += row[1] + avg_speed += row[2] avg_speed = round(avg_speed / fahrten, 1)