[Twisted-web] Subclassing a subclass of rend.Page

Patrick B. Day uf069 at victoria.tc.ca
Wed Sep 1 11:50:21 MDT 2004

A quick question. I have a situation where I'm starting from a base html
template, say 'template.html', which has some global elements which need
rendering. So I do something like this:

class Template (rend.Page):
   docFactory = rend.htmlfile('template.html')
   def render_global (self, context, data):
      """Fill in elements common to all pages."""

class GreetingsPage (Template):
   def render_contents (self, context, data):
      """Render contents area of page with greetings information."""

   def render_sidebar (self, context, data):
      """Render sidebar area of page specific to greetings."""

When I try this approach though, nevow seems to make all it's rendering
calls to Template and not GreetingsPage. What is the proper approach to
doing what I'm trying to do?

Thanks for your help.


Patrick Day
uf069 at victoria.tc.ca

More information about the Twisted-web mailing list