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
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
def delete(usn=None): DAL.delete(usn=usn) return json.dumps(pass_response)
def update(usn, student): DAL.update(student=student) return json.dumps(pass_response)
def read_one(usn=None): std = DAL.read_one(usn) return helper(std)
def read_all(): std = DAL.read_all() return helper(std)
def create(student): DAL.add(student) return json.dumps(pass_response)