On Oct 22, 5:35 pm, Jop <[email protected]> wrote: > Hello all, > > I've been googeling for a while but haven't been able to find a > solution for my problem. I will try to describe the problem > > I want to be able to set a variable in a view function on the start of > the request. During the same request i want to use the variables value > in a manager method. > > Originally I thought about using a session because I can import the > session object anywhere, but I want the value to be reset after the > request is closed. I also though about trying to define a 'setting' > during runtime, though this seems to be -not done-. > > I have the feeling there must be a real simple solution, but I can't > seem to figure it out. > > Any ideas? > > Thanx a lot! > > Jop
Use a middleware class to set the attribute on the request object, then pass that into the manage method from the view when you need to. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

