[mod_python] passing parameters from index() to POST method

Rob Fowler legal at mianos.com
Wed Mar 3 06:28:07 EST 2010


Excuse me if this has been answered, I have searched for an answer but I 
am open to someone saying 'FAQ ask this'.
I have a web form with this in it:
..
<FORM value="form" action="wifikeys.py/gen_keys" method="post">
..
the function 'gen_keys' needs a dictionary already read in the index 
function.

Is there a normal way to get an objects from 'index' to 'gen_keys' (in 
other words from the initial python function to the function called by 
the post)?

 From my understanding, apache calls the index function to get the data 
to populate the reply then the function yields back to apache, with 
nothing called until the client 'POSTS' then apache calls the post 
function specified.

I use a database so I already solved the lack of database handle on the 
post method using a singleton and simply instancing it in the post 
function (globals by any other name) but this function needs different 
data depending on the form.

TIA,
  Rob Fowler


More information about the Mod_python mailing list