~certify-web-dev/twisted/certify-trunk

« back to all changes in this revision

Viewing changes to sandbox/glyph/macrodemo/macrodemo.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2004-06-21 22:01:11 UTC
  • mto: (2.2.3 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040621220111-vkf909euqnyrp3nr
Tags: upstream-1.3.0
ImportĀ upstreamĀ versionĀ 1.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
from twisted.web.woven.controller import Controller
 
4
from twisted.web.woven.model import MethodModel
 
5
from twisted.web.woven.view import View
 
6
from twisted.web.woven.widgets import ExpandMacro
 
7
 
 
8
class SimpleView(View):
 
9
    def wvfactory_macro(self, request, node, model):
 
10
        return ExpandMacro(
 
11
                model,
 
12
                macroFile="macros.html",
 
13
                macroFileDirectory=self.templateDirectory,
 
14
                macroName="main")
 
15
 
 
16
 
 
17
class NothingModel(MethodModel):
 
18
    pass
 
19
 
 
20
class MacroDemo(Controller):
 
21
 
 
22
    templateDirectory = "."
 
23
    viewFactory = SimpleView
 
24
 
 
25
    def wchild_index(self, req):
 
26
        return self.makeView(NothingModel(), "page1.html")
 
27
 
 
28
    def wchild_page2(self, req):
 
29
        return self.makeView(NothingModel(), "page2.html")
 
30