views.py
def deleteStorm():
    """This function allows to remove a polygon from db"""
    if request.is_xhr and request.method=="POST":
        idDB = request.form['id']
        print("Polygon to be deleted with idDB",idDB)
        try:
            count1 = managedb.getCountLoginDB(session["username"])
            if count1 == 0:
                return json.dumps({"result": "exit"})
            result = managedb.deletePolygonDB(idDB)
            if result == "correct":
                return json.dumps({"result":"correct"})
            elif result == "empty":
                return json.dumps({"result": "empty"})
            else:
                return json.dumps({"result": "inconsistent"})
        except Exception as e:
            print("exception error DB ",str(e))
            return json.dumps({"result" : "error"})
This function allows to remove a polygon from db
This function allows to remove a polygon from db
This function allows to remove a polygon from db
def deleteStorm():
    if request.is_xhr and request.method=="POST":
        idDB = request.form['id']
        print("Polygon to be deleted with idDB",idDB)
        try:
            count1 = managedb.getCountLoginDB(session["username"])
            if count1 == 0:
                return json.dumps({"result": "exit"})
            result = managedb.deletePolygonDB(idDB)
            if result == "correct":
                return json.dumps({"result":"correct"})
            elif result == "empty":
                return json.dumps({"result": "empty"})
            else:
                return json.dumps({"result": "inconsistent"})
        except Exception as e:
            print("exception error DB ",str(e))
            return json.dumps({"result" : "error"})
def deleteStorm ( ) : if request . is_xhr and request . method == "POST" : idDB = request . form [ 'id' ] print ( "Polygon to be deleted with idDB" , idDB ) try : count1 = managedb . getCountLoginDB ( session [ "username" ] ) if count1 == 0 : return json . dumps ( { "result" : "exit" } ) result = managedb . deletePolygonDB ( idDB ) if result == "correct" : return json . dumps ( { "result" : "correct" } ) elif result == "empty" : return json . dumps ( { "result" : "empty" } ) else : return json . dumps ( { "result" : "inconsistent" } ) except Exception as e : print ( "exception error DB " , str ( e ) ) return json . dumps ( { "result" : "error" } )
This function allows to remove a polygon from db
This function allows to remove a polygon from db
"""This function allows to remove a polygon from db"""