Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,7 +52,10 @@ def fetch_personalized_data(session_index):
|
|
| 52 |
# Close the database connection
|
| 53 |
conn.close()
|
| 54 |
|
| 55 |
-
return [[str(row[0]), str(row[1]), str(row[2])] for row in rows] # Convert each row to a list
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
except mysql.connector.Error as err:
|
| 58 |
print(f"Error: {err}")
|
|
|
|
| 52 |
# Close the database connection
|
| 53 |
conn.close()
|
| 54 |
|
| 55 |
+
# return [[str(row[0]), str(row[1]), str(row[2])] for row in rows] # Convert each row to a list
|
| 56 |
+
# Convert the rows to a list of dictionaries
|
| 57 |
+
data = [{'playerNr': row[0], 'groupNr': row[1], 'subjectNr': row[2]} for row in rows]
|
| 58 |
+
return data
|
| 59 |
|
| 60 |
except mysql.connector.Error as err:
|
| 61 |
print(f"Error: {err}")
|