[web2py] Re: Passing pointer to session, requestion, etc objects to module

2010-11-01 Thread b00m_chef
oooh...I like it! Thanks! On Oct 31, 3:07 pm, "mr.freeze" wrote: > It's just a nice pattern to follow when building modules that need > access to the response/response/session.  Instead of passing them all > individually, you can just pass globals() and everything you need is > there, similar

[web2py] Re: Passing pointer to session, requestion, etc objects to module

2010-10-31 Thread mr.freeze
It's just a nice pattern to follow when building modules that need access to the response/response/session. Instead of passing them all individually, you can just pass globals() and everything you need is there, similar to auth and crud. auth = Auth(globals(),db) crud = Crud(globals(),db) On Oc

[web2py] Re: Passing pointer to session, requestion, etc objects to module

2010-10-31 Thread b00m_chef
The problem was that I was using self.session.forget() thinking that that would take care of getting rid of all of the session info. As soon as I got rid of that line though, everything worked as normal... As for references in python, that is how I thought python worked (coming from C++), but this

[web2py] Re: Passing pointer to session, requestion, etc objects to module

2010-10-31 Thread b00m_chef
thanks! On Oct 31, 6:12 am, "mr.freeze" wrote: > Python passes arguments by reference so they are not copies. Take a > look at the constructors for the Crud and Auth classes in gluon/ > tools.py. They receive a variable called 'environment' that contains > the session and request. > > On Oct 30,

[web2py] Re: Passing pointer to session, requestion, etc objects to module

2010-10-31 Thread mr.freeze
Python passes arguments by reference so they are not copies. Take a look at the constructors for the Crud and Auth classes in gluon/ tools.py. They receive a variable called 'environment' that contains the session and request. On Oct 30, 9:00 pm, b00m_chef wrote: > How does one go about passing a