On Wednesday, August 10, 2016 at 1:03:48 PM UTC-7, marchaos wrote: > > thanks dave, that's right, add() is a controller. > > however request.env["HTTP_REFERER"] doesn't work here for me: > > the add() function is called twice. first to generate the form and second > call to validate (form.process().accepted). > the second call validates the form and in case of success executes the > redirect() function but at that time the referer is ../add and not the view > ItemsByWhatever() which called the add() controller in the first place. > > the idea is to use a single add() controller for a variety of views and > returning to it. >
If the form hasn't been accepted and doesn't contain errors, you're on the first pass, and the referer should work. Write into the session and pull it out when the form is accepted. /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

