'endpoint to power the calendar heatmap on the welcome page'

@api
@has_access_api
@expose(u'/activity_per_day')
def activity_per_day(self):

    Log = models.Log
    qry = db.session.query(Log.dt, sqla.func.count()).group_by(Log.dt).all()
    payload = {str(time.mktime(dt.timetuple())): ccount for (dt, ccount) in qry if dt}
    return json_success(json.dumps(payload))
