Пример #1
0
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"))
Пример #2
0
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)
Пример #3
0
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")
Пример #4
0
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)
Пример #5
0
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)