[mod_python] better understanding of the req object

Graham Dumpleton graham.dumpleton at gmail.com
Mon Jun 4 19:45:44 EDT 2007


The functions (callable) and attributes are documented in:

  http://www.modpython.org/live/current/doc-html/pyapi-mprequest.html

If you look at prototype for write() in the documentation you will see
it takes two arguments, the second being optional.

The first argument is the text to write, the second is an integer used
as boolean value to indicate if flushing should occur.

You are passing a string instead of integer second argument so of
course you are going to get a TypeError.

Graham

On 05/06/07, David Bear <David.Bear at asu.edu> wrote:
> I'm trying to understand all the members/methods of the req object but
> anytime I try something like
>
> req.write('the uri is ', req.uri)
>
> or req.write('the hostname is ', req.hostname)
>
> I get an TypeError.
>
> I'm completely not understanding how to work with the req object.
>
> I assumed members would be 'callable' and return their value.
>
> --
> David Bear
> phone:  602-496-0424
> fax:    602-496-0955
> College of Public Programs/ASU
> University Center Rm 622
> 411 N Central
> Phoenix, AZ 85007-0685
>  "Beware the IP portfolio, everyone will be suspect of trespassing"
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list