[Twisted-Python] nuvow webform example?

Alan Ezust alan.ezust at gmail.com
Fri Dec 24 18:42:09 EST 2004


I have another question about the docs in nuvow webform. I'm following
the tutorial for nevow and I want to create a dynamic form with model.

http://www.divmod.org/Home/Projects/Nevow/index.html

I see an example of the webform, but it doesn't quite work:

class WebForm(rend.Page):
#   document = rend.stan(  # this should be changed to:
    docFactory = loaders.stan(
    tags.html[
    tags.body[
        h1["Here is the form:"],
        webform.renderForms('original')
    ]
])
resource = WebForm(Implementation())


I'm not sure I quite understand why 'original' goes there, but in any
case, I don't get any output from this. Is there something else that
needs to be fixed with this example?



On Fri, 24 Dec 2004 17:23:15 -0500, William Waites <ww at groovy.net> wrote:
> On Fri, Dec 24, 2004 at 01:50:46PM -0800, Alan Ezust wrote:
> > Ah, thanks...  the wait() did the trick.
> >
> > As it turned out, all I was doing was a little test apparently
> > creating and calling renderstring() immediately afterwards is a little
> > too soon for python  to handle, in this example...
> 
> Careful though -- wait is only appropriate to use in trivial
> examples. in fact it is only used in the test suite. It does
> some things that are not really allowed. Take a look at the
> implementation of wait.
> 
> It is really much better to schedule a callback -- this is the
> meaning of "you don't call twisted, twisted calls you".
> 
> Good luck,
> -w
> 
> --
> ... a poem about a haircut! But lofty, noble, tragic, timeless,
> full of love, treachery, retribution, quiet heroism in the face
> of certain doom! Six lines, cleverly rhymed, and every word
> beginning with the letter s!
>




More information about the Twisted-Python mailing list