[chronojump-server] gunicorn script uploadEncoderData reads resistance
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump-server] gunicorn script uploadEncoderData reads resistance
- Date: Wed, 17 May 2017 10:16:40 +0000 (UTC)
commit 44311c2d53444fd879834cd05f7d0dcb0a58dace
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed May 17 12:16:04 2017 +0200
gunicorn script uploadEncoderData reads resistance
main.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/main.py b/main.py
index 8b1a03b..3dd3563 100755
--- a/main.py
+++ b/main.py
@@ -103,7 +103,8 @@ def uploadEncoderData():
content = request.get_json()
personId = content.get('personId', 1)
- machineId = content.get('machineId', 1)
+ stationId = content.get('stationId', 1)
+ resistance = content.get('resistance', 0)
exerciseName = content.get('exerciseName', "unknown")
meanPowerBestRep = content.get('meanPowerBestRep', 0)
repsAbove50pBest = content.get('repsAbove50pBest', 0)
@@ -114,8 +115,8 @@ def uploadEncoderData():
(con, cur) = connect_db()
- print("INSERT INTO encoderData (personId, machineId, exerciseName, meanPowerBestRep, repsAbove50pBest)
VALUES (%s, %s, %s, %s, %s)", (personId, machineId, exerciseName, meanPowerBestRep, repsAbove50pBest))
- cur.execute("INSERT INTO encoderData (personId, machineId, exerciseName, meanPowerBestRep,
repsAbove50pBest) VALUES (%s, %s, %s, %s, %s)", (personId, machineId, exerciseName, meanPowerBestRep,
repsAbove50pBest))
+ print("INSERT INTO results (personId, stationId, resistance, exerciseName, meanPowerBestRep,
repsAbove50pBest) VALUES (%s, %s, %s, %s, %s, %s)", (personId, stationId, resistance, exerciseName,
meanPowerBestRep, repsAbove50pBest))
+ cur.execute("INSERT INTO results (personId, stationId, resistance, exerciseName, meanPowerBestRep,
repsAbove50pBest) VALUES (%s, %s, %s, %s, %s, %s)", (personId, stationId, resistance, exerciseName,
meanPowerBestRep, repsAbove50pBest))
con.commit()
return Response("", 202)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]