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

Commit 7d7fa343 by 李景熙

获取标注者bug

parent 3ba58686
...@@ -184,25 +184,19 @@ def get_state(user_id, data_id): ...@@ -184,25 +184,19 @@ def get_state(user_id, data_id):
# 获取某文件的标注者信息 # 获取某文件的标注者信息
def get_executors(data_id): def get_executors(data_id):
try: try:
find = Relation.select(Relation.user_id, Relation.relation_id, Relation.flag2).where( find = Relation.select(Relation.user_id, Relation.data_id, Relation.flag, Relation.flag2).where(
Relation.data_id == data_id, Relation.flag == 1) Relation.data_id == data_id, Relation.flag == 1)
index = 0 name = User.get_username(find[0].user_id)
list = [] data = {
while index < len(find): 'id': find[0].user_id,
name = User.get_username(find[index].user_id) 'relation_id': find[0].relation_id,
list.append(
{
'id': find[index].user_id,
'relation_id': find[index].relation_id,
'nickname': name, 'nickname': name,
'state': find[index].flag2, 'state': find[0].flag2,
} }
)
index += 1
except: except:
return Result(0, "get failed", {}) return Result(0, "get failed", {})
else: else:
return Result(1, "ok", list) return Result(1, "ok", data)
def get_relation_id(uid, did): def get_relation_id(uid, did):
...@@ -271,6 +265,7 @@ def check_slice_completed(slice_id): ...@@ -271,6 +265,7 @@ def check_slice_completed(slice_id):
else: else:
return False return False
def check_slice_shenhe_completed(slice_id): def check_slice_shenhe_completed(slice_id):
try: try:
find = Relation.select().where(Relation.slice_id == slice_id) find = Relation.select().where(Relation.slice_id == slice_id)
...@@ -290,4 +285,4 @@ if __name__ == '__main__': ...@@ -290,4 +285,4 @@ if __name__ == '__main__':
# Relation.delete().where(Relation.relation_id == 67).execute() # Relation.delete().where(Relation.relation_id == 67).execute()
# print(get_state(1, 5)) # print(get_state(1, 5))
# create_relation(3, 1, 2) # create_relation(3, 1, 2)
print(find_slice(26)) print(get_executors(16).code)
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