[chronojump-server] getTasks by stationId



commit ed81bc353b72cb71529cbe937f21c6afb36e73c5
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jun 28 18:14:31 2017 +0200

    getTasks by stationId

 main.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/main.py b/main.py
index 1ab5aea..b32cab7 100755
--- a/main.py
+++ b/main.py
@@ -129,11 +129,12 @@ def getTasks():
     content = request.get_json()
 
     personId  = content.get('personId', "")
+    stationId  = content.get('stationId', "")
 
     (con, cur) = connect_db(cursorclass=MySQLdb.cursors.DictCursor)
 
     #select everything exept datetime because is not serializable
-    cur.execute("SELECT task.id, task.type, task.personId, task.stationId, task.exerciseId, task.sets, 
task.nreps, task.load, task.speed, task.percentMaxSpeed, task.laterality, task.comment, task.done FROM task, 
person WHERE person.id = %s AND person.id = task.personId AND done = 0", (personId, ))
+    cur.execute("SELECT task.id, task.type, task.personId, task.stationId, task.exerciseId, task.sets, 
task.nreps, task.load, task.speed, task.percentMaxSpeed, task.laterality, task.comment, task.done FROM task, 
person WHERE person.id = %s AND person.id = task.personId AND task.stationId = %s AND done = 0", (personId, 
stationId))
     print(cur._last_executed)
     tasks = cur.fetchall()
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]