Colin Bean
ccbean at gmail.com
Thu Apr 10 15:16:12 EDT 2008
Are you looking for sessions ( http://modpython.org/live/current/doc-html/pyapi-sess.html )? That's really the only way to persist your object across redirects... Colin On Thu, Apr 10, 2008 at 12:08 PM, mail-lists <mail-lists at peachnet.com> wrote: > Sean Allen wrote: > > > > > On Apr 10, 2008, at 10:40 AM, mail-lists wrote: > > > > > Hello, > > > > > > I have a quick question and it might be very silly: > > > > > > How do I pass variables between pages short of building a query string > into the URL? Is there a way to set variables in the request object? > > > > > > What I'm trying to do is the following: > > > > > > user fills out a form > > > form calls saveform function > > > > > > > when? via an onSubmit handler? > > > > no, no JavaScript at all, sorry. I guess I wasn't very clear. Form > action=saveform which is a python function ( def saveform(req) ) > > > > > > > > > > > > input is validated > > > > > > > where is the input validated? in 'saveform' that is a javascript function? > > > > input is validated in saveform. > > > > > > > > > > > > if not valid input return to the form with user values filled out. > > > > > > > > > > what exactly is 'return' here? > > from a server side script? from a javascript validation routine? > > > > > return is a util.redirect back to the form. > > My question is how do I pass request variables BACK to the form short of > using a query string. > > ie. is it possible to do something like the following: > > req_data=util.FieldStorage(req) > req_data["form_item"]="ThisisastringIwanttopopulatetheformwith" > > I've tried this obviously but it doesn't work. I'm not sure if something > like this SHOULD work because I don't quite understand whether or not the > request object persists across the redirect. > > I hope I'm asking this in the right way :) > > > Thank you > > > > > > > > > > > > > _______________________________________________ > Mod_python mailing list > Mod_python at modpython.org > http://mailman.modpython.org/mailman/listinfo/mod_python >
|