# 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 @@ - + The title @@ -7,12 +8,12 @@

List of schemas

- +
diff -r c6c47034d2a4 -r ed8db63fab4f zpt/HTML_schema.zpt --- a/zpt/HTML_schema.zpt Thu Sep 02 16:38:50 2010 +0200 +++ b/zpt/HTML_schema.zpt Thu Sep 02 17:01:52 2010 +0200 @@ -1,18 +1,19 @@ - + The title -

List of tables for schema

+

List of tables for schema

- +
diff -r c6c47034d2a4 -r ed8db63fab4f zpt/HTML_schema_table.zpt --- a/zpt/HTML_schema_table.zpt Thu Sep 02 16:38:50 2010 +0200 +++ b/zpt/HTML_schema_table.zpt Thu Sep 02 17:01:52 2010 +0200 @@ -6,7 +6,7 @@ The title -

table

+

table

diff -r c6c47034d2a4 -r ed8db63fab4f zpt/JSONHTML_index.zpt --- a/zpt/JSONHTML_index.zpt Thu Sep 02 16:38:50 2010 +0200 +++ b/zpt/JSONHTML_index.zpt Thu Sep 02 17:01:52 2010 +0200 @@ -1,9 +1,10 @@ - +The title -

+  

\ No newline at end of file
diff -r c6c47034d2a4 -r ed8db63fab4f zpt/JSONHTML_schema.zpt
--- a/zpt/JSONHTML_schema.zpt	Thu Sep 02 16:38:50 2010 +0200
+++ b/zpt/JSONHTML_schema.zpt	Thu Sep 02 17:01:52 2010 +0200
@@ -1,9 +1,10 @@
-
+The title
-  

+  

\ No newline at end of file
diff -r c6c47034d2a4 -r ed8db63fab4f zpt/XML_index.zpt
--- a/zpt/XML_index.zpt	Thu Sep 02 16:38:50 2010 +0200
+++ b/zpt/XML_index.zpt	Thu Sep 02 17:01:52 2010 +0200
@@ -1,6 +1,7 @@
 
-
-  
+
+  
 	
   
 
\ No newline at end of file
diff -r c6c47034d2a4 -r ed8db63fab4f zpt/XML_schema.zpt
--- a/zpt/XML_schema.zpt	Thu Sep 02 16:38:50 2010 +0200
+++ b/zpt/XML_schema.zpt	Thu Sep 02 17:01:52 2010 +0200
@@ -1,6 +1,7 @@
 
-
-  
+ +
\ No newline at end of file