Martin, web.found should be raised as exception, not returned.

And I would use raise web.seeother for this purpose.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3


On Jul 22, 6:30 pm, "W. Martin Borgert" <[email protected]> wrote:
> Quoting digistam <[email protected]>:
>
> > I do not want to run the POST
> > action again when I hit the webbrowser refresh button. I only want to
> > run the POST action again when I turn back to the form page. I hope I
> > make myself clear. What will be the solution for my problem?
>
> You need to redirect the POSTs directly to the GETs. This way the
> last method is a GET and a reload in the browser will perform the
> GET. You want to change your POST into:
>
>      def POST(self):
>          form = myform()
>          session.count += 1
>          a = [[],[]]
>          ...
>          pages = dict([('val1',a[0]),('val2',a[1])])
>          return web.found(
>              web.ctx.env.get(
>                  u'HTTP_REFERER', u'/a-default-page/'))
>
> Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to