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

Donovan Preston dp at ulaluma.com
Wed Sep 1 12:16:56 MDT 2004

On Sep 1, 2004, at 1:50 PM, Patrick B. Day wrote:

> 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?

This should work properly, as you expect it to. Are you sure the page 
you are rendering is actually an instance of GreetingsPage and not 


More information about the Twisted-web mailing list