文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit 9b535aef by 李景熙

根据数据单创建任务

parent 9bdededf
from bson import ObjectId #引入ObjectId,方便使用objectid主键进行查询
from pymongo import MongoClient
from dao import Task
import datetime
host = '47.92.1.107' # 服务器url
......@@ -65,6 +66,7 @@ def set_complete(_id):
def createtask(id):
try:
result = collection.find_one({'_id': ObjectId(id)})
Task.create_task(result['user_id'], str(result['_id']))
for i in result['data_list']:
print(i['id'])
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment