I do this but I do not use Web.py Forms. I would just set the action
url
of my html forms to point at /index, this way you do not need any post
handlers for your other pages.

http://www.w3schools.com/tags/att_form_action.asp

If you can work out how to set the action on your Web.py form, you
could
do the same I think.

Jim


On Aug 25, 8:29 am, digistam <digis...@gmail.com> wrote:
> In my web.py project I have about 5 pages. All pages contain a
> standard search form. At the moment, each of the 5 pages has it's own
> class with always the same POST action:
>
> def POST(self):
> form = myform()
> if not form.validates():
> session.pages = 'none'
> return render.index(session.pages,form)
> else:
> index().POST()
>
> return render.index(session.pages,form)
>
> As you can see, the search form always does the same trick (just doing
> what's in the INDEX POST action). I'm sure this is not the best
> solution. I really would like to display the results on the index page
> and at the moment it's not. Now it's working like this:
>
> http://localhost:8080/page1-> search form action -> results are
> displayed onhttp://localhost:8080/page1
>
> http://localhost:8080/page2-> search form action -> results are
> displayed onhttp://localhost:8080/page2
>
> etc.
>
> This is not what I want, I want to have it like this:
>
> http://localhost:8080/page1-> search form action -> results are
> displayed onhttp://localhost:8080/index
>
> http://localhost:8080/page2-> search form action -> results are
> displayed onhttp://localhost:8080/index
>
> etc.
>
> I hope that I can explain this problem well enough. What's the
> solution to this ?
>
> Thanks in advance,
>
> Mark

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

Reply via email to