[chronojump-server] Added updateTask method
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump-server] Added updateTask method
- Date: Sun, 28 May 2017 22:38:35 +0000 (UTC)
commit 43554012b97a5694b40d7b06361837d5e2c3db38
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon May 29 00:35:15 2017 +0200
Added updateTask method
main.py | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/main.py b/main.py
index c936016..5fa760d 100755
--- a/main.py
+++ b/main.py
@@ -134,6 +134,29 @@ def getTasks():
return Response(json.dumps(tasks))
+@app.route("/updateTask", methods=['POST'])
+@auto.doc()
+def updateTask():
+ """chronojump client updates player task"""
+ content = request.get_json()
+
+ taskId = content.get('taskId', 1)
+ done = content.get('done', 1)
+
+ ip = request.remote_addr
+
+ (con, cur) = connect_db()
+
+ #print(taskId)
+ #print(done)
+
+ sqlStr = "UPDATE task SET done = \"" + str(done) + "\" WHERE id = \"" + str(taskId) + "\"";
+ print(sqlStr)
+ cur.execute(sqlStr)
+ con.commit()
+
+ return Response("", 202)
+
@app.route("/uploadEncoderData", methods=['POST'])
@auto.doc()
def uploadEncoderData():
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]