def h(self,id): hashCheck = shorturl.shortURL(self.metadata) res = hashCheck.getDataFromHash(id) if( len(res) > 0 ): return self.index(True,res) else: return self.index(False,res)
def h(self, id): hashCheck = shorturl.shortURL(self.metadata) res = hashCheck.getDataFromHash(id) if (len(res) > 0): return self.index(True, res) else: return self.index(False, res)
def addhash(self,mlon,mlat,zoom,slon,slat,dlon,dlat,saddress,daddress,time): cherrypy.response.headers['Content-Type']= 'application/json' hashAdd = shorturl.shortURL(self.metadata) hmd5 =hashAdd.addRouteToDatabase(mlon,mlat,zoom,slon,slat,dlon,dlat,saddress,daddress, time) if( len(hmd5) > 0 ): return json.dumps({ 'h': hmd5 }) else: return '{"error": "Add to DB failed"}'
def addhash(self, mlon, mlat, zoom, slon, slat, dlon, dlat, saddress, daddress, time): cherrypy.response.headers['Content-Type'] = 'application/json' hashAdd = shorturl.shortURL(self.metadata) hmd5 = hashAdd.addRouteToDatabase(mlon, mlat, zoom, slon, slat, dlon, dlat, saddress, daddress, time) if (len(hmd5) > 0): ret = {'h': hmd5} return json.dumps(ret) else: return '{"error": "Add to DB failed"}'