[mod_python] Adding user-defined objects to the request

Kevin Smith hawkeesk8 at yahoo.com
Sun Jul 20 09:10:39 EST 2003


I have been playing with mod_python for a while now
and would like to add my own non-trivial objects to
the request object.

I know that it is easy to add objects that are
built-in types such as:

session = {'Id':'&YFH%^%231234'}
req.session = session

Then, req.session, will be available to downstream
handlers to process.  But simply adding an object
doesn't appear to work if it is a user-defined type. 
I would like to do something similar to the following:

Class Session():

session = Session()
req.session = session

And then, later, in a downstream handler use my
defined methods:


I have searched the mailing list and the web in
general and can't find anything that is sending me in
the right direction nor telling me it is impossible. 
I have looked at pso and jotweb.  pso appears to
accomplish something similar to what I want but it
will take me weeks to unravel the trickery going on! 
I would just use pso but it does not implement an
authentication token the way I need to based on our
security needs.

Can someone help?

Many thanks in advance.

Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

More information about the Mod_python mailing list