def getLocations(self): self.connect() try: c = self.connection.cursor() c.execute('select * from POSHEA1."LOCATION"') a = [] for row in c: temp = Location('', '') temp.adapt(row) a.append(temp.dictify()) self.disconnect() return json.dumps(a) except: self.disconnect() return json.dumps([])