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
18ba6e9a
Commit
18ba6e9a
authored
Jul 05, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复选择分片的bug
parent
64186f40
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
12 deletions
+7
-12
Data.py
DAPlatform/Dao/Data.py
+3
-10
Relation.py
DAPlatform/Dao/Relation.py
+1
-0
Slice.py
DAPlatform/Dao/Slice.py
+2
-1
Task.py
DAPlatform/Dao/Task.py
+1
-1
No files found.
DAPlatform/Dao/Data.py
View file @
18ba6e9a
...
@@ -66,7 +66,6 @@ def find_data_by_slice(slice_id):
...
@@ -66,7 +66,6 @@ def find_data_by_slice(slice_id):
'name'
:
find
[
index
]
.
name
,
'name'
:
find
[
index
]
.
name
,
'size'
:
find
[
index
]
.
size
,
'size'
:
find
[
index
]
.
size
,
'url'
:
find
[
index
]
.
url
,
'url'
:
find
[
index
]
.
url
,
'state'
:
0
}
}
)
)
index
+=
1
index
+=
1
...
@@ -99,13 +98,6 @@ def find_url_by_slice(slice_id):
...
@@ -99,13 +98,6 @@ def find_url_by_slice(slice_id):
# 删除某分片下的文件
# 删除某分片下的文件
def
delete_data_by_slice
(
slice_id
):
def
delete_data_by_slice
(
slice_id
):
try
:
try
:
find
=
Data
.
select
(
Data
.
url
)
.
where
(
Data
.
slice_id
==
slice_id
)
index
=
0
while
index
<
len
(
find
):
file_dir
=
os
.
path
.
join
(
basedir
,
UPLOAD_FOLDER
,
find
[
index
]
.
url
)
if
os
.
path
.
exists
(
file_dir
):
os
.
remove
(
file_dir
)
index
+=
1
Data
.
delete
()
.
where
(
Data
.
slice_id
==
slice_id
)
.
execute
()
Data
.
delete
()
.
where
(
Data
.
slice_id
==
slice_id
)
.
execute
()
except
:
except
:
return
Result
(
0
,
"delete failed"
,
{})
return
Result
(
0
,
"delete failed"
,
{})
...
@@ -114,4 +106,5 @@ def delete_data_by_slice(slice_id):
...
@@ -114,4 +106,5 @@ def delete_data_by_slice(slice_id):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
delete_data_by_slice
(
10
)
Data
.
drop_table
()
\ No newline at end of file
Data
.
create_table
()
\ No newline at end of file
DAPlatform/Dao/Relation.py
View file @
18ba6e9a
...
@@ -42,5 +42,6 @@ def create_relation(slice_id, user_id, data_id):
...
@@ -42,5 +42,6 @@ def create_relation(slice_id, user_id, data_id):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
Relation
.
drop_table
()
Relation
.
create_table
()
Relation
.
create_table
()
# create_relation(3, 1, 2)
# create_relation(3, 1, 2)
DAPlatform/Dao/Slice.py
View file @
18ba6e9a
...
@@ -20,7 +20,7 @@ class Slice(Model):
...
@@ -20,7 +20,7 @@ class Slice(Model):
task_id
=
IntegerField
(
null
=
False
)
task_id
=
IntegerField
(
null
=
False
)
model_id
=
CharField
(
null
=
True
)
model_id
=
CharField
(
null
=
True
)
illustration
=
TextField
(
null
=
True
)
illustration
=
TextField
(
null
=
True
)
Annotaion_number
=
IntegerField
(
null
=
False
,
default
=
0
)
Annota
t
ion_number
=
IntegerField
(
null
=
False
,
default
=
0
)
document_number
=
IntegerField
(
null
=
False
,
default
=
0
)
document_number
=
IntegerField
(
null
=
False
,
default
=
0
)
type
=
FixedCharField
(
null
=
0
)
type
=
FixedCharField
(
null
=
0
)
...
@@ -169,4 +169,5 @@ def find_task_by_slice(slice_id):
...
@@ -169,4 +169,5 @@ def find_task_by_slice(slice_id):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
Slice
.
drop_table
()
Slice
.
create_table
()
Slice
.
create_table
()
DAPlatform/Dao/Task.py
View file @
18ba6e9a
...
@@ -160,7 +160,7 @@ def set_state(task_id, state):
...
@@ -160,7 +160,7 @@ def set_state(task_id, state):
except
:
except
:
return
False
return
False
else
:
else
:
t
.
state
=
state
t
.
task_
state
=
state
t
.
save
()
t
.
save
()
return
True
return
True
...
...
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