Re: New `pre_handler()` method on Class-Based Views

2016-04-06 Thread Diederik van der Boor
Too bad the issue was already closed. I’ve added my 2 cents: https://github.com/django/django/pull/6416#issuecomment-206301186 I’d expect having a View.setup() method would simplify things for both simple use case and complex projects. Best, Diederik > Op 5 apr. 2016, om 15:20 heeft Tim Graham

Re: New `pre_handler()` method on Class-Based Views

2016-04-05 Thread Tim Graham
See the discussion on the pull request: https://github.com/django/django/pull/6416 Aymeric says, "The GCBV API is already widely criticized for being too complicated. I think that adding one method to save one line of code is a bad trade-off. I'm -1." On Sunday, April 3, 2016 at 3:35:26 PM UTC

Re: New `pre_handler()` method on Class-Based Views

2016-04-03 Thread Ryan Hiebert
I have taken to using a prepare method called from dispatch which takes the request args, and I use it primarily to resolve ids in the url to db objects. This sounds like it fills a similar purpose. Sent from my iPhone > On Apr 3, 2016, at 14:07, Pablo Recio wrote: > > Hey there, > > Wanted

New `pre_handler()` method on Class-Based Views

2016-04-03 Thread Pablo Recio
Hey there, Wanted to share an idea I had during some discussions in DjangoCon EU. When using CBV, sometimes we have to replicate behaviour between different handlers. For instance setting up certain objects, extra user checks... Normally the way to achieve this is to override the `dispatch()`,