def show_semesters(): semesters = model.listSemesters() semesters = [dict(row) for row in semesters] for semester in semesters: semester["hours"] = model.getTotalHours(g.user_id, semester['id']) return render_template('semesters.html', student = model.getStudent(g.user_id), semesters = semesters, hours = model.getTotalHours(g.user_id, None))
def admin_show_student(id): semesters = model.listSemestersForStudent(id) semesters = [dict(row) for row in semesters] for semester in semesters: semester["hours"] = model.getTotalHours(None, semester['id']) return render_template('admin/student_semesters.html', student = model.getStudent(id), semesters = semesters, hours = model.getTotalHours(id, None))
def admin_show_semester(id): if request.args.get('_method', default=None) == 'DELETE': return admin_delete_semester(id) else: students = model.listStudentsForSemester(id) students = [dict(row) for row in students] for student in students: student["hours"] = model.getTotalHours(student["id"], id) return render_template('admin/semester_students.html', students = students, semester = model.getSemester(id), hours = model.getTotalHours(None, id), reflections = model.getSemesterReflections(id))
def admin_show_hours(student_id, semester_id): return render_template('admin/hours.html', student = model.getStudent(student_id), semester = model.getSemester(semester_id), entries = model.listHourEntries(student_id, semester_id), hours = model.getTotalHours(student_id, semester_id), reflection = model.getReflection(student_id, semester_id))
def show_students(): students = model.listStudents() students = [dict(row) for row in students] for student in students: student["hours"] = model.getTotalHours(student["id"], None) return render_template('admin/students.html', students = students)
def admin_show_semesters(): semesters = model.listSemesters() semesters = [dict(row) for row in semesters] for semester in semesters: semester["hours"] = model.getTotalHours(None, semester['id']) return render_template('admin/semesters.html', semesters=semesters)
def show_hours(id): return render_template('hours.html', student = model.getStudent(g.user_id), semester = model.getSemester(int(id)), entries = model.listHourEntries(g.user_id, int(id)), hours = model.getTotalHours(g.user_id, int(id)))