changeset 40:fbd3ce67c821

use executeSQL in getkmlname
author casties
date Wed, 01 Sep 2010 21:03:08 +0200
parents f6d9a3caf986
children f94fc5a51a38
files RestDbInterface.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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]