Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,688
Issues
1,688
List
Boards
Labels
Service Desk
Milestones
Merge Requests
84
Merge Requests
84
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
b585d2e1
Commit
b585d2e1
authored
Nov 10, 2020
by
Ryan Herbert
Committed by
Mikaël Salson
Nov 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mysql trickiness for file sizes
parent
ce025c5b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
server/web2py/applications/vidjil/models/SampleSet.py
server/web2py/applications/vidjil/models/SampleSet.py
+4
-5
server/web2py/applications/vidjil/models/sample_set_list.py
server/web2py/applications/vidjil/models/sample_set_list.py
+1
-0
No files found.
server/web2py/applications/vidjil/models/SampleSet.py
View file @
b585d2e1
...
...
@@ -77,10 +77,9 @@ class SampleSet(object):
def
get_files_values
(
self
,
data
):
key
=
get_file_sizes_select
()
tmp
=
[]
if
data
.
_extra
[
key
]
is
None
else
data
.
_extra
[
key
].
split
(
','
)
file_count
=
len
(
tmp
)
sizes
=
[
int
(
s
.
split
(
';'
)[
1
])
for
s
in
tmp
]
return
file_count
,
sum
(
sizes
)
size
=
0
if
data
.
_extra
[
key
]
is
None
else
data
.
_extra
[
key
]
file_count
=
data
.
file_count
return
file_count
,
size
def
get_files
(
self
,
data
):
file_count
,
size
=
self
.
get_files_values
(
data
)
...
...
@@ -229,4 +228,4 @@ def get_group_names_select():
return
"GROUP_CONCAT(DISTINCT auth_group.role)"
def
get_file_sizes_select
():
return
"
GROUP_CONCAT(DISTINCT (sequence_file.id || ';' || sequence_file.size_file)
)"
return
"
COUNT(DISTINCT sequence_file.id) * SUM(sequence_file.size_file) / COUNT(*
)"
server/web2py/applications/vidjil/models/sample_set_list.py
View file @
b585d2e1
...
...
@@ -56,6 +56,7 @@ class SampleSetList():
s_table
.
sample_set_id
.
with_alias
(
'sample_set_id'
),
s_table
.
info
.
with_alias
(
'info'
),
db
.
auth_user
.
last_name
.
with_alias
(
'creator'
),
db
.
sequence_file
.
id
.
count
(
True
).
with_alias
(
'file_count'
),
group_file_sizes
,
group_configs
,
group_config_ids
,
...
...
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