コード例 #1
0
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}))
コード例 #2
0
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"]}))
コード例 #3
0
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)
コード例 #4
0
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}))