[mod_python] Adding user-defined objects to the request

Kevin Smith hawkeesk8 at yahoo.com
Mon Jul 21 03:21:25 EST 2003


Actually, I think I may have just found the problem
which brings up another question ...

I was trying to do the addition of the object to the
request in the InitHandler.  I then noticed that I
could not even get a simple type to add to the request
in this phase of the handling.  Is that normal
behaviour?  The earliest that I seemed to be able to
add an object to the request was HeaderParser phase.

Can someone confirm or deny that the HeaderParser is
the earliest (inside a 'Location/Directory' context)
that you can add objects/attributes to the request?

In light of this, and Stian's comment, I shall try to
add my user-defined object at this phase instead.

Thanks
--- Stian Søiland <stian at soiland.no> wrote:
> 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]


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


More information about the Mod_python mailing list