[mod_python] Adding user-defined objects to the request

StianSøiland stian at soiland.no
Sun Jul 20 18:40:57 EST 2003

On 2003-07-20 18:10:39, Kevin Smith wrote:

> 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():
> ...

I can't see why this should not work, we do the same thing, but with a
user defined Session (that basically just store itself to disk on
__del__). Are you sure you don't have a path problem or namespace
problem? What is type(req.session) and repr(req.session) further down in
your pipeline?

Stian Søiland               Work toward win-win situation. Win-lose
Trondheim, Norway           is where you win and the other lose.
http://www.soiland.no/      Lose-lose and lose-win are left as an
                            exercise to the reader.  [Limoncelli/Hogan]

More information about the Mod_python mailing list