Commit fccb101a authored by sebastien letort's avatar sebastien letort

function fmt_date turned to private function, so that it does not appear in autodoc.

parent 2fb1f109
......@@ -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) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment