def getUsrLogin(): get_student = Student.Student.query.filter_by(email=current_user.email) student_schema = Student.StudentSchema(many=True) student = student_schema.dump(get_student) return make_response(jsonify({"studentInfo":student}))
def getTuition(studentId): student = Student.Student.query.filter_by(studentId=studentId) student_schema = Student.StudentSchema(many=True) students = student_schema.dump(student) return make_response(jsonify({"student_fee": students[0]["fee"]}))
def createStu(): data = request.get_json() stu_schema = Student.StudentSchema() student = stu_schema.load(data) rs = stu_schema.dump(student.create()) return make_response(jsonify({"student": rs}),201)
def getStudent(): get_stus = Student.Student.query.all() student_schema = Student.StudentSchema(many=True) students = student_schema.dump(get_stus) return make_response(jsonify({"students": students}))