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 ModelForm. and
Django must provide schema migration tools.




On 3月22日, 上午10时33分, Alex Ogier <[email protected]> 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 Django's notion of identity
> and the username and/or email fields. The change is transparent to Django's
> test suite, and I did my best to leave the existing API identical.
>
> My hope is that we can make, for example, contrib.admin only dependent on a
> class implementing PermissionsMixin. Whether we do late binding to
> auth.User with some jiggery-poker as described in the recent auth.User
> reboot thread, load time plugging into the auth.User inheritance list as I
> proposed in the first email in this thread, or just punt on the whole thing
> and ask people to implement their own concrete classes, I think the
> refactoring is a nice backwards-compatible way to expose pieces of
> auth.User for people to reuse and/or depend on.
>
> https://github.com/ogier/django/tree/auth-mixins
>
> Does anyone have any opinions?
>
> -Alex Ogier

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to