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
allgo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
110
Issues
110
List
Boards
Labels
Service Desk
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
allgo
allgo
Commits
fccb101a
Commit
fccb101a
authored
Feb 21, 2019
by
sebastien letort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
function fmt_date turned to private function, so that it does not appear in autodoc.
parent
2fb1f109
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
django/allgo/api/v1/metrics.py
django/allgo/api/v1/metrics.py
+4
-4
No files found.
django/allgo/api/v1/metrics.py
View file @
fccb101a
...
...
@@ -23,7 +23,7 @@ log = logging.getLogger('allgo')
# ======================================
# ~ DATE_FMT = "%d-%m-%Y %H:%M"
def
fmt_date
(
date
):
def
__
fmt_date
(
date
):
"""date is datetime object (for from/to)"""
# ~ return datetime.strftime( date, DATE_FMT )
return
date
.
date
().
isoformat
()
...
...
@@ -54,8 +54,8 @@ def __api_dict(from_, to, step, l_records ):
"""from_ and to are datetime.datetime object."""
return
{
'data'
:
l_records
,
'from'
:
fmt_date
(
from_
),
'to'
:
fmt_date
(
to
),
'from'
:
__
fmt_date
(
from_
),
'to'
:
__
fmt_date
(
to
),
'step'
:
step
,
}
...
...
@@ -90,7 +90,7 @@ def nb_jobs_per_user(app_id, from_=None, to=None, step=None):
# SLETORT: There should be a "django" way of doing this !
for
d_res
in
res
:
d_res
[
'uname'
]
=
d_res
.
pop
(
'user__username'
)
d_res
[
'time_period'
]
=
fmt_date
(
d_res
.
pop
(
'time_period'
)
)
d_res
[
'time_period'
]
=
__
fmt_date
(
d_res
.
pop
(
'time_period'
)
)
return
__api_dict
(
from_
,
to
,
step
,
list
(
res
)
);
...
...
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