views.py
def checkLabel():
    """This function allows to change the label of a polygon"""
    if request.is_xhr and request.method=="POST":
        idDB = request.form["id"]
        #print("modifica label del Polygon con idDB",idDB)
        #print("nuova etichetta",name)
        try:
            count,result1,cursorPolygon = managedb.checkLabelPolygononIdDB(idDB)
            if(count == 1):
                result2 = {"result":"correct","label":cursorPolygon["properties"]["name"]}
                print result2
                return result2
            elif(count == 0):
                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 change the label of a polygon
This function allows to change the label of a polygon
This function allows to change the label of a polygon
def checkLabel():
    if request.is_xhr and request.method=="POST":
        idDB = request.form["id"]
        try:
            count,result1,cursorPolygon = managedb.checkLabelPolygononIdDB(idDB)
            if(count == 1):
                result2 = {"result":"correct","label":cursorPolygon["properties"]["name"]}
                print result2
                return result2
            elif(count == 0):
                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 checkLabel ( ) : if request . is_xhr and request . method == "POST" : idDB = request . form [ "id" ] try : count , result1 , cursorPolygon = managedb . checkLabelPolygononIdDB ( idDB ) if ( count == 1 ) : result2 = { "result" : "correct" , "label" : cursorPolygon [ "properties" ] [ "name" ] } print result2 return result2 elif ( count == 0 ) : 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 change the label of a polygon
This function allows to change the label of a polygon
"""This function allows to change the label of a polygon""" #print("modifica label del Polygon con idDB",idDB) #print("nuova etichetta",name)