3 ms·
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) w
by zeemonkee 16y ago
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.