changeset 25:cef1bfa821cb

fixed problem with not passing request
author casties
date Mon, 23 Aug 2010 10:57:59 +0200
parents f3811d9a36da
children 2b73f868d34f
files RestDbInterface.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/RestDbInterface.py	Fri Aug 20 12:01:41 2010 +0200
+++ b/RestDbInterface.py	Mon Aug 23 10:57:59 2010 +0200
@@ -201,7 +201,7 @@
             return self.showListOfTables(format=format,schema=path[1])
         elif len(path) == 3:
             # table
-            if request.get("method") == "POST" and request.get("create_table_file",None) is not None:
+            if REQUEST.get("method") == "POST" and REQUEST.get("create_table_file",None) is not None:
                 # POST to table to check
                 return self.checkTable(format=format,schema=path[1],table=path[2])
             # else show table
@@ -250,6 +250,8 @@
         """returns PageTemplate with tables"""
         logging.debug("showtable")
         # should be cross-site accessible 
+        if RESPONSE is None:
+            RESPONSE = self.REQUEST.RESPONSE
         RESPONSE.setHeader('Access-Control-Allow-Origin', '*')
         # GIS gets special treatment
         if format=="GIS":
@@ -275,6 +277,8 @@
         """returns PageTemplate with list of tables"""
         logging.debug("showlistoftables")
         # should be cross-site accessible 
+        if RESPONSE is None:
+            RESPONSE = self.REQUEST.RESPONSE
         RESPONSE.setHeader('Access-Control-Allow-Origin', '*')
 
         pt = getattr(self.template, '%s_schema'%format, None)
@@ -300,6 +304,8 @@
         """returns PageTemplate with list of schemas"""
         logging.debug("showlistofschemas")
         # should be cross-site accessible 
+        if RESPONSE is None:
+            RESPONSE = self.REQUEST.RESPONSE
         RESPONSE.setHeader('Access-Control-Allow-Origin', '*')
 
         pt = getattr(self.template, '%s_index'%format, None)