# HG changeset patch # User casties # Date 1283367788 -7200 # Node ID fbd3ce67c821b34bd39bac0c4ae0bbe5f7e35a29 # Parent f6d9a3caf986700a0a06babb042c0f69b09ef33e use executeSQL in getkmlname diff -r f6d9a3caf986 -r fbd3ce67c821 RestDbInterface.py --- a/RestDbInterface.py Wed Sep 01 19:58:16 2010 +0200 +++ b/RestDbInterface.py Wed Sep 01 21:03:08 2010 +0200 @@ -626,8 +626,9 @@ # Mapping a set of points from table-based SQL-query: if data!=None: try: - SQL="""SELECT \"attribute with gis_id\" FROM public.metadata WHERE tablename LIKE '"""+table+"""'""" - gisIDattribute=self.ZSQLSimpleSearch(SQL) + SQL='SELECT "attribute with gis_id" FROM public.metadata WHERE tablename = %s' + res = self.executeSQL(SQL, (table,)) + gisIDattribute = res['rows'][0][0] except: return "table not registered within metadata" @@ -641,7 +642,7 @@ yCoord=getattr(dataset,'y_coord') except: #try: - gisID=getattr(dataset,getattr(gisIDattribute[0],'attribute with gis_id')) + gisID=getattr(dataset,gisIDattribute) coords=self.getPoint4GISid(gisID) if coords!=None: xCoord=coords[0]