summaryrefslogtreecommitdiff
path: root/examples/todo_sql/sitepage.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/todo_sql/sitepage.py')
-rw-r--r--examples/todo_sql/sitepage.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/todo_sql/sitepage.py b/examples/todo_sql/sitepage.py
new file mode 100644
index 0000000..9c88685
--- /dev/null
+++ b/examples/todo_sql/sitepage.py
@@ -0,0 +1,35 @@
+import os
+from Component import CPage
+from Component.notify import NotifyComponent
+from ZPTKit import ZPTComponent
+from todo_sql.db import *
+
+class SitePage(CPage):
+
+ components = [
+ ZPTComponent([os.path.join(os.path.dirname(__file__),
+ 'templates')]),
+ NotifyComponent()]
+
+ def title(self):
+ return self.options.get('title', CPage.title(self))
+
+ def awake(self, trans):
+ CPage.awake(self, trans)
+ self.baseURL = self.request().environ()['todo_sql.base_url']
+ self.baseStaticURL = self.baseURL + '/static'
+ self.options.lists = list(TodoList.select())
+ self.setup()
+
+ def setup(self):
+ pass
+
+ def sleep(self, trans):
+ self.teardown()
+ CPage.sleep(self, trans)
+
+ def teardown(self):
+ pass
+
+ def writeHTML(self):
+ self.writeTemplate()