def students_registered_class(classes): active_class = Classes.select().where(Classes.title**classes).get() student_ids = Studentclass.select().where( Studentclass.classes_id == active_class.id) results = [] for student_id in student_ids: student = Student.select().where(Student.id == student_id).get() results.append({'name': student.name, 'email': student.email}) return jsonify(results)
def course_registration(): all_classes = Classes.select() all_students = Student.select() return render_template('course_registration.html', all_classes=all_classes, all_students=all_students)