[Twisted-web] IRedirectAfterPost

Donovan Preston dp at ulaluma.com
Thu May 27 16:51:17 MDT 2004

On May 27, 2004, at 8:37 AM, vicky wrote:

> Hi,
>       I'm having some problems with iformless.IRedirectAfterPost.  The 
> first
> time I post my form, I see my results' page with the data posted.  But 
> when
> I use "back" on my browser and I try to post my form again, the
> IRedirectAfterPost doesn't seem to be done.  It bring me back the page 
> with
> the form posted (no data in my fields). Only once out of two my form is
> posted correctly even if I'm using the back button.  I didn't find out 
> how
> to fix it.

I believe the current version of formless only lets you set 
IRedirectAfterPost on the request, so you will have to set it on the 
request object associated with the form post, not the form render -- 
this could be why you are having problems with the wrong redirect 
occurring after you use the back button.

As for why your form is only working every other time, I can only guess 
that there must be a problem with your code. Are you sure you are 
properly waiting on a deferred, if you are using one? I have seen code 
that doesn't wait on a deferred work "every other time" because in 
between the first page and the second page render, the first deferred 
fires, and a callback stores this data in a place where the second page 
render can find it.


More information about the Twisted-web mailing list