Nevow Manual Question
"John J. Dooley" <[email protected]> Mon, 20 Feb 2006 21:31:32 -0800
| Newsgroups | gmane.comp.python.quotient.dev |
|---|---|
| Message-ID | <[email protected]> |
I am trying to follow the Nevow manual and the example below left me a bit
confused. Unlike, the prevoius examples there was no illustrated output.
There is the obvious Leaf("eggs") behavior. However, the Root class and the
childFactory returning Leaf left me baffled about how Root() should be
called to see the effect of Leaf() and what was supposed to be illustrated.
o I think the page.Page was supposed to be rend.Page.
o The illustrative calling sequence and output would be useful for sanity
checking whether this is a editor "fat finger" or a reader "fat head".
If anyone can me whether this is an obvious document error or supply me
with the way to call Root to trigger Leaf, I would be grateful.
Also: Is this the right mailing list for this question? Perhaps, it
depends on whether it is an error and whether document bugs are considered
development bugs.
Thanks,
John Dooley
>From Nevow Manual|Object Publishing|Functions in the DOM
class Root(page.Page):
docFactory = loaders.stan(tags.html[
tags.h1["Welcome."],
tags.a(href="foo")["Foo"],
tags.a(href="bar")["Bar"],
tags.a(href="baz")["Baz"]])
def childFactory(self, ctx, name):
return Leaf(name)
def greet(ctx, name):
return "Hello. You are visiting the ", name, " page."
class Leaf(rend.Page):
docFactory = loaders.stan(tags.html[greet])