, 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
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
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
> 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
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
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
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
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