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
5eb47d72
Commit
5eb47d72
authored
Aug 14, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
限制用户多次选择同一文件
parent
2a80221f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Relation.py
DAPlatform/dao/Relation.py
+8
-5
No files found.
DAPlatform/dao/Relation.py
View file @
5eb47d72
...
@@ -31,9 +31,11 @@ class Relation(Model):
...
@@ -31,9 +31,11 @@ class Relation(Model):
# 创建标注关系
# 创建标注关系
def
create_relation
(
slice_id
,
user_id
,
data_id
):
def
create_relation
(
slice_id
,
user_id
,
data_id
):
try
:
try
:
Slice
.
add_annotation
(
slice_id
)
r
=
Relation
.
get
(
slice_id
=
slice_id
,
user_id
=
user_id
,
data_id
=
data_id
)
relation
=
Relation
(
slice_id
=
slice_id
,
user_id
=
user_id
,
data_id
=
data_id
)
if
not
r
:
relation
.
save
()
Slice
.
add_annotation
(
slice_id
)
relation
=
Relation
(
slice_id
=
slice_id
,
user_id
=
user_id
,
data_id
=
data_id
)
relation
.
save
()
except
:
except
:
return
Result
(
0
,
"create failed"
,
{})
return
Result
(
0
,
"create failed"
,
{})
else
:
else
:
...
@@ -215,7 +217,8 @@ def get_relation_id(uid, did):
...
@@ -215,7 +217,8 @@ def get_relation_id(uid, did):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
Relation
.
drop_table
()
# Relation.drop_table()
Relation
.
create_table
()
# Relation.create_table()
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)
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