Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
inspect_report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Open sidebar
zhengjinlei
inspect_report
Commits
ba2f79d3
Commit
ba2f79d3
authored
Nov 12, 2019
by
zhengjinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取得分最低top10
parent
94899c82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tasksapi.py
src/inspect_report/api/tasksapi.py
+3
-3
No files found.
src/inspect_report/api/tasksapi.py
View file @
ba2f79d3
...
...
@@ -96,7 +96,7 @@ class TasksApi(viewsets.ViewSet):
:return:
"""
task_id
=
req
.
data
.
get
(
'task'
,
''
)
num
=
req
.
data
.
get
(
'num'
,
'1
5
'
)
num
=
req
.
data
.
get
(
'num'
,
'1
0
'
)
start_date
=
req
.
data
.
get
(
'start_date'
,
(
datetime
.
now
()
+
timedelta
(
days
=-
30
))
.
strftime
(
'
%
Y-
%
m-
%
d'
))
end_date
=
req
.
data
.
get
(
'end_date'
,
(
datetime
.
now
()
+
timedelta
(
days
=
1
))
.
strftime
(
'
%
Y-
%
m-
%
d'
))
task_condition
=
{
'createdAt__gte'
:
start_date
,
'createdAt__lt'
:
end_date
}
...
...
@@ -132,7 +132,7 @@ class TasksApi(viewsets.ViewSet):
:return:
"""
task_id
=
req
.
data
.
get
(
'task'
,
''
)
num
=
req
.
data
.
get
(
'num'
,
'1
5
'
)
num
=
req
.
data
.
get
(
'num'
,
'1
0
'
)
start_date
=
req
.
data
.
get
(
'start_date'
,
(
datetime
.
now
()
+
timedelta
(
days
=-
30
))
.
strftime
(
'
%
Y-
%
m-
%
d'
))
end_date
=
req
.
data
.
get
(
'end_date'
,
(
datetime
.
now
()
+
timedelta
(
days
=
1
))
.
strftime
(
'
%
Y-
%
m-
%
d'
))
task_condition
=
{
'createdAt__gte'
:
start_date
,
'createdAt__lt'
:
end_date
}
...
...
@@ -153,7 +153,7 @@ class TasksApi(viewsets.ViewSet):
return_data
[
agent_name
]
+=
check
.
score
else
:
return_data
[
agent_name
]
=
check
.
score
data_max
=
sorted
(
return_data
.
items
(),
key
=
lambda
item
:
item
[
1
],
reverse
=
Tru
e
)
data_max
=
sorted
(
return_data
.
items
(),
key
=
lambda
item
:
item
[
1
],
reverse
=
Fals
e
)
data_max
=
data_max
[:
int
(
num
)]
data_max_return
=
{}
for
dm
in
data_max
:
...
...
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