Re: Closures, Django Request Object, Django architecture

2009-08-25 Thread Matthias Kestenholz
On Tue, Aug 25, 2009 at 8:35 PM, Dennis Fogg wrote: > PS: more succinctly: status notifications can happen in many places and > passing the session to all these places just for the status notification > does not make the code any clearer.  Thus, I just want to access the

Re: Closures, Django Request Object, Django architecture

2009-08-25 Thread Dennis Fogg
PS: more succinctly: status notifications can happen in many places and passing the session to all these places just for the status notification does not make the code any clearer. Thus, I just want to access the session as a global variable -- how can I do that? On Wed, Aug 26, 2009 at 2:30

Re: Closures, Django Request Object, Django architecture

2009-08-25 Thread Dennis Fogg
I looked at my code based on your feedback. In this particular case, the code that needs the request is doing status notifications http://blog.ianbicking.org/web-application-patterns-status-notification.html and it needs access to the session from the request object. You are correct in that what

Re: Closures, Django Request Object, Django architecture

2009-08-25 Thread Matthias Kestenholz
On Tue, Aug 25, 2009 at 7:32 PM, Dennis wrote: > > I seem to need the Django HttpRequest object in functions that are > called by view functions. > I could pass the request, but I'm thinking of trying to create a > closure in middleware so that > I can access the request

Closures, Django Request Object, Django architecture

2009-08-25 Thread Dennis
I seem to need the Django HttpRequest object in functions that are called by view functions. I could pass the request, but I'm thinking of trying to create a closure in middleware so that I can access the request object (and maybe other objects) from anywhere. This seems like it's stretching the