Re: Class based views: A standard hook for http-method-independent code

2012-11-18 Thread Jordan Hagan
, Daniel Sokolowski wrote: > >>>> > >>>> I’ve done the below in the past, the only issue with that is if you > have > >>>> side effects in parent’s dispatch you don’t want executed but you > would also > >>>> run that risk if you had an initialize

Re: Class based views: A standard hook for http-method-independent code

2012-11-08 Thread Jordan Hagan
t(), > and put it *in dispatch()*. The sequence of calls is *identical*, and since > *args and **kwargs are locals, they don't need to be set anywhere. What's > the problem with putting the init() logic in the dispatch() method in the > way I described? > > Yours, > Russ

Re: Class based views: A standard hook for http-method-independent code

2012-11-08 Thread Jordan Hagan
Hey Russ, The main point of concern which I think you may be missing is that self.kwargs and self.args are set inside dispatch, so using other mixins that require self.kwargs and self.args to be set (most do) will not work, without doing: def dispatch(self, request, *args, **kwargs): self.arg

Re: Class based views: A standard hook for http-method-independent code (and a proposal for an init() method)

2012-11-05 Thread Jordan Hagan
> From my count there are 8 people in this thread in support of the >> functionality, and 2 people against it (1 at the time of my previous >> message). >> > > The bit you're possibly missing due to the way GMail handles some replied: > this thread was a respawn of an older thread from 6 month

Re: Class based views: A standard hook for http-method-independent code (and a proposal for an init() method)

2012-11-05 Thread Jordan Hagan
it does seem to me like something that anyone who is making extensive use of class based views will eventually come up against. Cheers, Jordan On Tuesday, 6 November 2012 12:07:19 UTC+13, Russell Keith-Magee wrote: > > > On Tue, Nov 6, 2012 at 2:20 AM, Jordan Hagan > > wrote: > >&g

Re: Class based views: A standard hook for http-method-independent code (and a proposal for an init() method)

2012-11-05 Thread Jordan Hagan
any typos. -- > On Nov 1, 2012 12:31 PM, "Aaron Merriam" > > wrote: > >> Just wanted to put my +1 into this thread. I've been fighting for a >> clean way to implement permissions in class based views and the 'init' >> method would help my imp

Re: Class based views: A standard hook for http-method-independent code (and a proposal for an init() method)

2012-10-31 Thread Jordan Hagan
time, the permission check needs information from things like >> "self.object", and the URL kwargs. >> That's because the permission check is role based; clients only see their >> views, counselors may inspect their clients, etc.. >> Implementing the check half-way

Re: Class based views: A standard hook for http-method-independent code

2012-10-30 Thread Jordan Hagan
I would really like to see something like Meshy's proposed solution implemented as this is an issue that I've run into a few times as well. Although I can appreciate TiNo's argument of: > self.request = request > ... This creates a problem for methods that are going to be used in the overridde