Beispiel #1
0
def delete_page():
    result = DAL.read_one(usn=request.get_json()["id"])
    if result:
        form = StudentForm()
        form.usn.data = result.usn
        return render_template("delete.html", form=form)
    return "Error", 404
Beispiel #2
0
def update_page():
    result = DAL.read_one(usn=request.get_json()["id"])
    if result:
        form = StudentForm()
        form.usn.data = result.usn
        form.fname.data = result.fname
        form.lname.data = result.lname
        form.email.data = result.email
        form.gpa.data = result.gpa
        form.phone.data = result.phone_no
        return render_template("update.html", form=form)
    return "Error", 404
Beispiel #3
0
def delete(usn=None):
    DAL.delete(usn=usn)
    return json.dumps(pass_response)
Beispiel #4
0
def update(usn, student):
    DAL.update(student=student)
    return json.dumps(pass_response)
Beispiel #5
0
def read_one(usn=None):
    std = DAL.read_one(usn)
    return helper(std)
Beispiel #6
0
def read_all():
    std = DAL.read_all()
    return helper(std)
Beispiel #7
0
def create(student):
    DAL.add(student)
    return json.dumps(pass_response)