[Twisted-web] webform success message?

Cory Dodt corydodt at twistedmatrix.com
Tue Nov 16 14:31:56 MST 2004

One approach to take is like this:
   <body n:render="amICompleted">
   <div n:pattern="notCompleted">
    ... the regular form ...
   <div n:pattern="completed">
    ... the success message ...

and then do a ctx.onePattern('completed') or 'notCompleted' somewhere in
render_amICompleted.  You can determine whether or not it's completed by
examining IHand(ctx), which is the return value of your autocallable.

The html above will present either one or the other, either the form or the
success message.  You can easily adapt this so you get either the
form-without-completed-message or the form-with-completed-message, I'll leave
that as an exercise to you.  The key thing is knowing about IHand.


Alexander May wrote:
> When a form is submitted successfully using webform, is there a way to add a
> success message to the re-rendered form output? 
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

More information about the Twisted-web mailing list