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
1a151b8c
Commit
1a151b8c
authored
Jul 09, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在Relation中添加标注结果id属性并增加修改函数
parent
5a8d9326
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
Relation.py
DAPlatform/dao/Relation.py
+14
-3
No files found.
DAPlatform/dao/Relation.py
View file @
1a151b8c
...
...
@@ -20,6 +20,7 @@ class Relation(Model):
slice_id
=
IntegerField
(
null
=
False
)
user_id
=
IntegerField
(
null
=
False
)
data_id
=
IntegerField
(
null
=
False
)
result_id
=
IntegerField
()
flag
=
BooleanField
(
default
=
False
)
# 代表该标注关系是否被标注
score
=
IntegerField
(
default
=
0
)
receive_time
=
DateTimeField
(
default
=
datetime
.
datetime
.
now
())
...
...
@@ -50,8 +51,18 @@ def find_slice_by_executor(user_id):
return
slice_list
def
set_result_id
(
userid
,
dataid
,
resultid
):
try
:
relation
=
Relation
.
get
(
Relation
.
user_id
==
userid
,
Relation
.
data_id
==
dataid
)
relation
.
result_id
=
resultid
relation
.
save
()
except
:
return
False
else
:
return
True
if
__name__
==
'__main__'
:
# Relation.drop_table()
# Relation.create_table()
print
(
find_slice_by_executor
(
1
))
Relation
.
drop_table
()
Relation
.
create_table
()
# create_relation(3, 1, 2)
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