Re: auth.User: The abstract base class idea

2012-03-23 Thread Matteius
I agree on both this point and your future point about using a migration tool such as South (and South is truly the only one I can think of that will do this painlessly). We definitely suffer from these User model problems at our Company as does everyone I think that really uses Django's authentic

Re: auth.User: The abstract base class idea

2012-03-22 Thread Alex Ogier
> > It looks OK, but there is one really big issue with your approach - > database blowup. > You can easily choose mixins to compose your User model, but once it's > done your database layout is fixed. > If you then decide to use different mixins - it would be impossible > without very smart db sch

Re: auth.User: The abstract base class idea

2012-03-22 Thread Mateusz Marzantowicz
On Thu, Mar 22, 2012 at 3:33 AM, Alex Ogier wrote: > I made a topic branch and refactored everything I thought was nicely > reusable from auth.User into abstract models in > django/contrib/auth/mixins.py. There are some good reusable pieces inside > auth.User, even if you want to entirely scrap D

Re: auth.User: The abstract base class idea

2012-03-22 Thread bhuztez
Maybe we could make every model pluggable. so User model could be defined like this: class User(models.Model): __mixins__ = load_available_mixins(settings.AUTH_MODEL_MIXINS) But AFAICS, Django will suffer from the same issue as PHP register_globals / Rails mass-assignment, because of ModelFo

Re: auth.User: The abstract base class idea

2012-03-21 Thread Alex Ogier
I made a topic branch and refactored everything I thought was nicely reusable from auth.User into abstract models in django/contrib/auth/mixins.py. There are some good reusable pieces inside auth.User, even if you want to entirely scrap Django's notion of identity and the username and/or email fiel

Re: auth.User: The abstract base class idea

2012-03-20 Thread Alex Ogier
> This is pretty much exactly what django-primate does, except it includes a > special metaclass to allow > overriding of default fields. Yeah, that is the basic idea. I think that permissions and associated code should be moved from UserBase to live directly on auth.User or in a mixin of their ow

Re: auth.User: The abstract base class idea

2012-03-20 Thread Donald Stufft
On Tuesday, March 20, 2012 at 11:25 AM, Alex Ogier wrote: > There have been various proposals about replacing the User class with > an abstract base class. Ian Lewis has a semi-workable version at > http://ianlewis.bitbucket.org/django-newauth/index.html but its > proposal met with resistance in pa

auth.User: The abstract base class idea

2012-03-20 Thread Alex Ogier
There have been various proposals about replacing the User class with an abstract base class. Ian Lewis has a semi-workable version at http://ianlewis.bitbucket.org/django-newauth/index.html but its proposal met with resistance in part because there's not a great migration path from existing apps.