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
7d640c7b
Commit
7d640c7b
authored
Jun 27, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在文件数据库中添加大小size属性
parent
67617317
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
Data.py
DAPlatform/Dao/Data.py
+6
-3
Slice.py
DAPlatform/Dao/Slice.py
+1
-0
Task.py
DAPlatform/Dao/Task.py
+1
-0
task.py
DAPlatform/views/task.py
+3
-0
No files found.
DAPlatform/Dao/Data.py
View file @
7d640c7b
...
...
@@ -18,6 +18,7 @@ class Data(Model):
data_id
=
AutoField
(
primary_key
=
True
,
unique
=
True
)
slice_id
=
IntegerField
(
null
=
False
)
name
=
CharField
(
null
=
False
,
max_length
=
30
)
size
=
IntegerField
(
null
=
False
)
url
=
CharField
(
null
=
False
,
unique
=
True
)
class
Meta
:
...
...
@@ -25,10 +26,10 @@ class Data(Model):
# 向数据库中添加原始数据
def
create_data
(
slice_id
,
name
,
url
):
def
create_data
(
slice_id
,
name
,
size
,
url
):
try
:
Slice
.
add_file
(
slice_id
)
data
=
Data
(
slice_id
=
slice_id
,
name
=
name
,
url
=
url
)
data
=
Data
(
slice_id
=
slice_id
,
name
=
name
,
size
=
size
,
url
=
url
)
data
.
save
()
except
Exception
:
return
Result
(
0
,
"create failed"
,
{})
...
...
@@ -57,7 +58,9 @@ def find_data_by_slice(slice_id):
list
.
append
(
{
'id'
:
find
[
index
]
.
data_id
,
'name'
:
find
[
index
]
.
name
'name'
:
find
[
index
]
.
name
,
'size'
:
find
[
index
]
.
size
,
'state'
:
0
}
)
index
+=
1
...
...
DAPlatform/Dao/Slice.py
View file @
7d640c7b
...
...
@@ -119,4 +119,5 @@ if __name__ == '__main__':
# create_text_slice(1,1)
# create_pic_slice(1, "标注坐标(30,100)")
# create_layer_slice(1, "。。。。。。")
Slice
.
drop_table
()
Slice
.
create_table
()
DAPlatform/Dao/Task.py
View file @
7d640c7b
...
...
@@ -145,4 +145,5 @@ def add_slice(task_id):
if
__name__
==
'__main__'
:
# delete_task(10)
Task
.
drop_table
()
Task
.
create_table
()
DAPlatform/views/task.py
View file @
7d640c7b
...
...
@@ -46,6 +46,7 @@ def create_task():
j
=
0
while
j
<
len
(
data
[
'task'
][
'domains'
][
i
][
'fileName'
]):
Data
.
create_data
(
s
.
data
,
data
[
'task'
][
'domains'
][
i
][
'fileName'
][
j
][
'name'
],
data
[
'task'
][
'domains'
][
i
][
'fileName'
][
j
][
'size'
],
data
[
'task'
][
'domains'
][
i
][
'fileName'
][
j
][
'url'
])
j
+=
1
i
+=
1
...
...
@@ -55,6 +56,7 @@ def create_task():
j
=
0
while
j
<
len
(
data
[
'task'
][
'pictureDomains'
][
i
][
'fileName'
]):
Data
.
create_data
(
s
.
data
,
data
[
'task'
][
'pictureDomains'
][
i
][
'fileName'
][
j
][
'name'
],
data
[
'task'
][
'pictureDomains'
][
i
][
'fileName'
][
j
][
'size'
],
data
[
'task'
][
'pictureDomains'
][
i
][
'fileName'
][
j
][
'url'
])
j
+=
1
i
+=
1
...
...
@@ -64,6 +66,7 @@ def create_task():
j
=
0
while
j
<
len
(
data
[
'task'
][
'layerDomains'
][
i
][
'fileName'
]):
Data
.
create_data
(
s
.
data
,
data
[
'task'
][
'layerDomains'
][
i
][
'fileName'
][
j
][
'name'
],
data
[
'task'
][
'layerDomains'
][
i
][
'fileName'
][
j
][
'size'
],
data
[
'task'
][
'layerDomains'
][
i
][
'fileName'
][
j
][
'url'
])
j
+=
1
i
+=
1
...
...
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