# HG changeset patch # User casties # Date 1283439712 -7200 # Node ID ed8db63fab4f1fd41d290edea4e9aebe49e9e663 # Parent c6c47034d2a4903179b80503f6ff0606c2115b32 more refactoring of templates diff -r c6c47034d2a4 -r ed8db63fab4f RestDbInterface.py --- a/RestDbInterface.py Thu Sep 02 16:38:50 2010 +0200 +++ b/RestDbInterface.py Thu Sep 02 17:01:52 2010 +0200 @@ -87,15 +87,15 @@ JSONHTML_schema = PageTemplateFile('zpt/JSONHTML_schema', globals()) JSONHTML_schema_table = PageTemplateFile('zpt/JSONHTML_schema_table', globals()) # JSON_* templates are scripts - def JSON_index(self,data): + def JSON_index(self): """JSON index function""" self.REQUEST.RESPONSE.setHeader("Content-Type", "application/json") - json.dump(data, self.REQUEST.RESPONSE) + json.dump(self.getListOfSchemas(), self.REQUEST.RESPONSE) - def JSON_schema(self,data,schema): + def JSON_schema(self,schema): """JSON index function""" self.REQUEST.RESPONSE.setHeader("Content-Type", "application/json") - json.dump(data, self.REQUEST.RESPONSE) + json.dump(self.getListOfTables(schema), self.REQUEST.RESPONSE) def JSON_schema_table(self,schema,table): """JSON index function""" @@ -324,8 +324,8 @@ if pt is None: return "ERROR!! template %s_schema not found"%resultFormat - data = self.getListOfTables(schema) - return pt(data=data,schema=schema) + #data = self.getListOfTables(schema) + return pt(schema=schema) def getListOfTables(self,schema='public',username='guest'): """return list of tables""" @@ -351,8 +351,8 @@ if pt is None: return "ERROR!! template %s_index not found"%resultFormat - data = self.getListOfSchemas() - return pt(data=data) + #data = self.getListOfSchemas() + return pt() def getListOfSchemas(self,username='guest'): """return list of schemas""" diff -r c6c47034d2a4 -r ed8db63fab4f zpt/HTML_index.zpt --- a/zpt/HTML_index.zpt Thu Sep 02 16:38:50 2010 +0200 +++ b/zpt/HTML_index.zpt Thu Sep 02 17:01:52 2010 +0200 @@ -1,4 +1,5 @@ - +