[mod_python] Re: Quickie question for you

Jorey Bump list at joreybump.com
Wed Mar 16 18:52:37 EST 2005


Graham Dumpleton wrote:
> I have now pushed this discussion onto the mailing where
> it should be. :-)
> 
>  Davin Boling wrote ..
> 
>>Thing is, I'm specifying the method manually. I should have mentioned that.
>>
>>
>><form action="http://demo.wordpainter.net/content/login" method="post">
>>       <div>
>>        Handle:
>>        <input type="text" name="handle" maxlength="32"/>
>>
>>        Password:
>>        <input type="password" name="password" maxlength="32"/>
>>        <input type="submit" name="login" value="Log in!"/>
>>       </div>
>></form>
>>
>>
>>When a submission is made from this form, I can't pull "handle", 
>>"password", or even "login" from a util.FieldStorage instance. req.read
>>appears to be returning a blank string.
> 
> 
> Without the code for your specific handler, hard to tell. If by handler
> you simply mean something that is running under mod_python.publisher
> then mod_python.publisher will already have consumed all data for a
> post and so req.read() wouldn't return anything nor would FieldStorage
> be able to decode anything for a post if you ran it your self. In the case
> of mod_python.publisher, the FieldStorage instance it created will be
> accessible as req.form.

As Graham mentions, the Publisher handler returns this info in the 
req.form dictionary, so you would look at:

  req.form['handle']
  req.form['password']
  req.form['login']



More information about the Mod_python mailing list