News for hackers. Stuff that matters.
Re:Reasons Django 1.3 will be awesome by zeemonkee on Wednesday November 10, 2010 @01:15PM (#1891280)
The problem with auth is that it was designed before model inheritance was available, hence the crappy get_profile() hack.

A better solution (with hindsight) would be a base abstract UserBase model with a bunch of useful features (e.g. password encryption) extended by a default User model, plus a UserForeignKey field similar to the one in GAE. Therefore instead of this:

    class BlogPost(models.Model):
        author = models.ForeignKey(User)
you would have this:

    class BlogPost(models.Model):
        author = UserForeignKey()
The exact user class would be set in your settings, e.g. AUTH_USER_MODEL = "myapp.MyUser".

That would provide more interop between Django apps requiring some form of user authentication. Not sure what other implications that would have though.

There are no comments on this comment yet.