# HG changeset patch # User casties # Date 1282553879 -7200 # Node ID cef1bfa821cbbeca20c4544179d6db16a6bca9f2 # Parent f3811d9a36da252cf700b4d07b02affb82c1164b fixed problem with not passing request diff -r f3811d9a36da -r cef1bfa821cb RestDbInterface.py --- 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)