views.py
def listClassPolygon():
    """This function allows to ask db for the polygons' classes list"""
    if request.is_xhr and request.method=="POST":
        try:
            dateold = request.form['dateStr']
            datenew = datetime(int(dateold[0:4]), int(dateold[4:6]), int(dateold[6:8]), int(dateold[9:11]))
            #print("Individuare classi di Polygon con datetime : ", str(datenew))
            result, cursorListClassPolygon = managedb.groupByClassPolygonDB(datenew)
            if (result == False):
                print("Polygons' classes: there aren't results")
                return json.dumps({"result": "empty"})
            else:
                print("Polygons' classes: there are results")
                print(cursorListClassPolygon)
                cursorListClassClusterJSON = mytools.modifyClassPolygonJSON(cursorListClassPolygon)
                return cursorListClassClusterJSON
                #return json.dumps({"result": "ok"})
        except Exception as e:
            print("exception error DB", str(e))
            return json.dumps({"result": "error"})
This function allows to ask db for the polygons' classes list
This function allows to ask db for the polygons' classes list
This function allows to ask db for the polygons ' classes list
def listClassPolygon():
    if request.is_xhr and request.method=="POST":
        try:
            dateold = request.form['dateStr']
            datenew = datetime(int(dateold[0:4]), int(dateold[4:6]), int(dateold[6:8]), int(dateold[9:11]))
            result, cursorListClassPolygon = managedb.groupByClassPolygonDB(datenew)
            if (result == False):
                print("Polygons' classes: there aren't results")
                return json.dumps({"result": "empty"})
            else:
                print("Polygons' classes: there are results")
                print(cursorListClassPolygon)
                cursorListClassClusterJSON = mytools.modifyClassPolygonJSON(cursorListClassPolygon)
                return cursorListClassClusterJSON
        except Exception as e:
            print("exception error DB", str(e))
            return json.dumps({"result": "error"})
def listClassPolygon ( ) : if request . is_xhr and request . method == "POST" : try : dateold = request . form [ 'dateStr' ] datenew = datetime ( int ( dateold [ 0 : 4 ] ) , int ( dateold [ 4 : 6 ] ) , int ( dateold [ 6 : 8 ] ) , int ( dateold [ 9 : 11 ] ) ) result , cursorListClassPolygon = managedb . groupByClassPolygonDB ( datenew ) if ( result == False ) : print ( "Polygons' classes: there aren't results" ) return json . dumps ( { "result" : "empty" } ) else : print ( "Polygons' classes: there are results" ) print ( cursorListClassPolygon ) cursorListClassClusterJSON = mytools . modifyClassPolygonJSON ( cursorListClassPolygon ) return cursorListClassClusterJSON except Exception as e : print ( "exception error DB" , str ( e ) ) return json . dumps ( { "result" : "error" } )
This function allows to ask db for the polygons' classes list
This function allows to ask db for the polygons ' classes list
"""This function allows to ask db for the polygons' classes list""" #print("Individuare classi di Polygon con datetime : ", str(datenew)) #return json.dumps({"result": "ok"})