2011/8/15 digistam <[email protected]>:
> My situation is this:
>
> web.config.debug = False
> urls = ('/', 'index','','index','/pageone','pageone')
> app = web.application(urls, globals())
> session = web.session.Session(app, web.session.DiskStore('sessions'),
> {'count': 0})
> render = web.template.render('templates', globals={'context':session})
>
> class index:
>    def GET(self):
>            form = myform()
>            etc.
>            return render.index(session.pages,form)
>    def POST(self):
>            form = myform()
>            etc.
>            return render.index(session.pages,form)
>
> class pageone:
>    def GET(self):
>            form = myform()
>            etc.
>            return render.index(session.pages,form)
>    def POST(self):
>        form = myform()
>        session.count += 1
>        if not form.validates():
>            session.pages = 'none'
>            return render.index(session.pages,form)
>        else:
>            index().POST()
>
> It is working. However, when a user is on the pageone page and uses
> the form to search for items, the url stays http://localhost:8080/pageone
> but I would like to redirect the user to http://localhost:8080 again
> and show the search results there.
>
> I have thought about raise web.seeother but I don't understand how to
> use it in combination with render.index(session.pages,form)

I think the search form should have action="/" and you should handle
the search in index.GET or index.POST based on the form method.

Anand

-- 
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