Re: request object needed in form methods

2009-03-19 Thread Thomas Guettler
>> Why not store the request >> object (in a thread safe way) on module level? ... > The biggest con is encourages bad design practices, the way Python works is > you have a global and local scope, if you want something in your local scope > you pass it to it. > > If you really want to have the

Re: request object needed in form methods

2009-03-19 Thread Daniel Roseman
On Mar 19, 1:22 pm, Thomas Guettler wrote: > Hi, > > I know that you can pass the request object to form like this: > > class MyForm(forms.Form): >     def __init__(self, request, *args, **kwargs): >         self.request=request >         forms.Form.__init__(self, *args,

Re: request object needed in form methods

2009-03-19 Thread Alex Gaynor
On Thu, Mar 19, 2009 at 9:22 AM, Thomas Guettler wrote: > > Hi, > > I know that you can pass the request object to form like this: > > class MyForm(forms.Form): >def __init__(self, request, *args, **kwargs): >self.request=request >forms.Form.__init__(self,

request object needed in form methods

2009-03-19 Thread Thomas Guettler
Hi, I know that you can pass the request object to form like this: class MyForm(forms.Form): def __init__(self, request, *args, **kwargs): self.request=request forms.Form.__init__(self, *args, **kwargs) Somehow I am tired of rewriting this. Why not store the request object