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
87ee539c
Commit
87ee539c
authored
Jul 05, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改创建标注关系功能
parent
42813969
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
26 deletions
+4
-26
Relation.py
DAPlatform/Dao/Relation.py
+1
-23
Slice.py
DAPlatform/Dao/Slice.py
+3
-3
No files found.
DAPlatform/Dao/Relation.py
View file @
87ee539c
...
...
@@ -32,7 +32,7 @@ class Relation(Model):
# 创建标注关系
def
create_relation
(
slice_id
,
user_id
,
data_id
):
try
:
Slice
.
add_
file
(
slice_id
)
Slice
.
add_
annotation
(
slice_id
)
relation
=
Relation
(
slice_id
=
slice_id
,
user_id
=
user_id
,
data_id
=
data_id
)
relation
.
save
()
except
:
...
...
@@ -41,28 +41,6 @@ def create_relation(slice_id, user_id, data_id):
return
Result
(
1
,
"create success"
,
{})
# 根据用户id找寻标注关系
def
find_relationbyuserid
(
user_id
):
try
:
p
=
Relation
.
get
(
Relation
.
user_id
==
user_id
)
except
Exception
:
return
Result
(
0
,
"find failed"
,
{})
else
:
return
Result
(
1
,
"find success"
,
p
.
email
)
# 根据数据id找标注关系
def
find_relationbydataid
(
data_id
):
if
not
Relation
.
table_exists
():
Relation
.
create_table
()
try
:
p
=
Relation
.
get
(
Relation
.
data_id
==
data_id
)
except
Exception
:
return
Result
(
0
,
"find failed"
,
{})
else
:
return
Result
(
1
,
"find success"
,
p
.
email
)
if
__name__
==
'__main__'
:
Relation
.
create_table
()
# create_relation(3, 1, 2)
DAPlatform/Dao/Slice.py
View file @
87ee539c
...
...
@@ -74,7 +74,7 @@ def delete_slice_by_task(task_id):
return
Result
(
1
,
"delete success"
,
{})
# 查找某任务下的分片
# 查找某任务下的分片
(用于在分片列表中显示)
def
find_slice_by_task
(
task_id
):
try
:
find
=
Slice
.
select
(
Slice
.
slice_id
,
Slice
.
document_number
,
Slice
.
type
,
Slice
.
model_id
,
Slice
.
illustration
)
.
where
(
...
...
@@ -118,7 +118,7 @@ def add_file(slice_id):
return
True
# 添加
文件
# 添加
标注关系
def
add_annotation
(
slice_id
):
try
:
s
=
Slice
.
get
(
Slice
.
slice_id
==
slice_id
)
...
...
@@ -130,7 +130,7 @@ def add_annotation(slice_id):
return
True
# 查找任务下的分片id及描述
# 查找任务下的分片id及描述
(用于修改任务时的返回)
def
find_slice_annotation_by_task
(
task_id
,
type
):
try
:
find
=
Slice
.
select
(
Slice
.
slice_id
,
Slice
.
type
,
Slice
.
model_id
,
...
...
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