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

2012-11-07 Thread Mike Fogel
I prefer django-rest-framework's flow through dispatch(). You can override self.initial() to safely execute method-agnostic logic, but unlike your example, it doesn't have to return a response object. The response object is returned by the appropriate self.() as usual.

Re: Possible deprecation of depth= in select_related

2012-11-07 Thread ptone
On Wednesday, November 7, 2012 1:48:09 AM UTC-8, Marc Tamlyn wrote: > > It seems there had been a little confusion as to exactly what the initial > proposal was. I had assumed it was just about removing the `depth` argument > but it was still possible to pass *no* arguments to get the implicit

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

2012-11-07 Thread Aaron Merriam
I wanted to post and modified version of a gist posted earlier in this thread. https://gist.github.com/4032482 I originally implemented the original structure of having an `init` hook which was called between setting request, args, and kwargs, but i quickly found that I had a few situations

Re: Custom user models in 1.5, not flexible/dry enough?

2012-11-07 Thread Tino de Bruijn
+1 for the mixin approach. I needed to copy 90% of the AbstractUser model just to make the email field unique and remove the username field. The permission requirements I usually have are compatible with the one's used by the admin, but the username field is superfluous. As soon as your permission

Re: Possible deprecation of depth= in select_related

2012-11-07 Thread Marc Tamlyn
It seems there had been a little confusion as to exactly what the initial proposal was. I had assumed it was just about removing the `depth` argument but it was still possible to pass *no* arguments to get the implicit "follow everything" behaviour. In fact Luke was suggesting that we remove

Re: Custom user models don't like non integer primary keys.

2012-11-07 Thread Bruno ReniƩ
On Wed, Nov 7, 2012 at 12:06 AM, Russell Keith-Magee wrote: > Hi Eric, > > Although the full stack trace would confirm it, I think I can guess what the > problem is here -- it's the mechanism for generating reset tokens. > > If you dig into the token generation (and

Re: Custom user models in 1.5, not flexible/dry enough?

2012-11-07 Thread Florian Apolloner
Hi Alex, On Tuesday, November 6, 2012 11:55:39 PM UTC+1, Alex Ogier wrote: > > So, I went ahead and implemented the most useful mixin of the three that I > defined previously, the PermissionsMixin. > I am not really sold on the idea of having this PermissionMixin, for one reason: If I need a