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

2012-03-04 Thread Charlie "meshy" Denton
Firstly, please excuse my double post: I didn't realise posts are vetted, so I thought it had been lost. The very significant advantage of this being a hook (instead of overriding dispatch) is that it allows you to call methods that require dispatch to have already set variables (eg: self.kwarg

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

2012-03-04 Thread Tino de Bruijn
I don't really see what difference another function makes. Say https://gist.github.com/1957251 is implemented, what makes: def prepare_view(self, request, *args, **kwargs): # the thing I want to do super(ClassName, self).prepare_view(request, *args, **kwargs) preferable over: def dispatc