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()`,

Re: A helpful ImportError for manage.py when Django isn't installed/available

2016-04-03 Thread Collin Anderson
We could also wait til after we remove py2 support in January. That way we can be sure that on py3 it will also print the original exception so it doesn't get hidden. (Right?) On Fri, Apr 1, 2016 at 6:23 AM, Shai Berger wrote: > An idea: Catch the exception; in the handler, try to simply "import

utils.suppress_warning, TestCase.assertWarns

2016-04-03 Thread Shai Berger
Hi all, While working on a ticket that had to do with cookies, I found myself writing this code (essentially): with warnings.catch_warnings(record=True) as warnings_log: # # Begin actual code I'm trying to test # CsrfViewMiddleware().proces

"Save as new" should redirect to the created item instead of list view

2016-04-03 Thread Markus Amalthea Magnuson
Currently, using the "Save as new" button will redirect to the list view, while it would be more useful for it to redirect to the newly created item. This also makes it much easier to create a series of new objects where the next one only differs slightly from the last one. There is a ticket for t

Feedback on improving GeoDjango docs

2016-04-03 Thread Sylvain Fankhauser
Hello, I'm currently working on ticket #22274 , which is an effort to improve the GeoDjango documentation to make it more accessible to newcomers. This represents quite some work and I'm still in the early stages but I'd love to have some feedback on th