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

Commit 704e4247 by 李景熙

ObjectId引入

parent 273453e0
......@@ -52,7 +52,7 @@ def delete_all():
# 将数据单生成任务后更改状态
def set_complete(_id):
try:
condition = {'_id': _id}
condition = {'_id': ObjectId(_id)}
ds = collection.find_one(condition)
ds['complete'] = 1
result = collection.update_one(condition, ds)
......@@ -65,11 +65,8 @@ def set_complete(_id):
# 根据数据单id创建任务
def createtask(id):
try:
results = collection.find()
for i in results:
if str(i.pop("_id")) == id:
print(111)
print(i.pop("user_id"))
result = collection.find_one({'_id': ObjectId(id)})
print(result['data_list'])
except Exception as e:
print(e)
return False
......
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