Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
7d7fa343
Commit
7d7fa343
authored
Sep 21, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取标注者bug
parent
3ba58686
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
Relation.py
DAPlatform/dao/Relation.py
+9
-14
No files found.
DAPlatform/dao/Relation.py
View file @
7d7fa343
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment