예제 #1
0
def template_imports():  # put things into table for template rendering
    res = {}

    res["grades_array"] = get_all_grades()
    res["subjects_array"] = get_all_subjects()
    res["timedelta"] = timedelta
    return res
예제 #2
0
def json_api():
    json_data = {}
    json_data['grades'] = get_all_grades()
    json_data['subjects'] = get_all_subjects()
    json_data['homeworks'] = get_all_homeworks()
    json_data['day_elements'] = get_all_day_db()

    return json.dumps(json_data, default=encode_b)