[Twisted-web] Nevow IResource trouble
mailinglists at smartology.nl
Fri Nov 18 08:41:59 MST 2005
Remi Cool wrote:
>Hello, after batteling with XMLRPC and getting nevow to put something on
>the screen, I got stuck implementing a livepage and webform example.
>After changing the implements to inevow.IResource in httpResource, I got
>a message about a missing locateChild method (is that about the same as
>the getChild method in a twisted web resource?) ... I've created one,
>but I'm not shure if it's correct.
>Bottomline is I can't get it to work, not from the code and not from a
>resource file ... what's wrong with this code?
I was using twisted.web.static and not nevow.static and that mistake was
responsible for the cannotAdapt errors.
The webforms example worked after changing the ISimpleMethod class to:
def simple(self, name=String(description="Your name."),
Please enter your name and age.
simple = annotate.autocallable(simple)
The Livepage example also needed a little touchup ...
addSlash = True
docFactory = loaders.stan(
def handle_greeter(self, ctx, value):
return livepage.alert("you've clicked %s" % value)
Most important was the tags.head[livepage.glue] addition.
Now that everything works, I can go on to the next step (pfew) ...
calling the client from the server with livepage, sessions,
authentication and experimenting with nufox XUL.
- Remi -
More information about the Twisted-web