def database_delete(id): if request.method == "GET": database = db.get_database_details(id) return render_template("delete_database.html", database=database) elif request.method == "POST": db.delete_database(id) flash("Delete Successful", "success") return redirect(url_for("index"))
def cleartables(): """ Clears all the database tables @return: html page to show status """ ret,guestmsg = db.delete_database(dbname, "guest", "") if ret: guestmsg="Deleted" ret,domainmsg = db.delete_database(dbname, "domain", "") if ret: domainmsg="Deleted" ret,devicemsg = db.delete_database(dbname, "device", "") if ret: devicemsg="Deleted" return render_template("clear-tables.html", guest=guestmsg,domain=domainmsg,device=devicemsg)
def clearguesttable(): """ Clears the guest table @return: html page to show status """ ret,guestmsg = db.delete_database(dbname, "guest", "") if ret: guestmsg="Deleted" return render_template("clear-tables.html", guest=guestmsg,domain="Not Deleted",device="Not Deleted")
def cleardevicetable(): """ Clears the device table @return: html page to show status """ ret,devicemsg = db.delete_database(dbname, "device", "") if ret: devicemsg="Deleted" return render_template("clear-tables.html", guest="Not Deleted",domain="Not Deleted",device=devicemsg)
def cleartables(): """ Clears all the database tables @return: html page to show status """ ret,guestmsg = db.delete_database(dbname, "users", "") if ret: users="Deleted" return render_template("clear-tables.html", users=users)