Reputation: 1469
I would like to use django-avatar with my own model. Is it possible to do that?
login/models.py
class LoginInfo(models.Model):
real_name = models.CharField(max_length=100, null=True, blank=True)
website = models.URLField(blank=True, null=True)
birthday = models.DateField(null=True, blank=True)
login = models.OneToOneField(Login, primary_key=True) # contain user_name, pw, mail
Thanks for the help!
Upvotes: 1
Views: 543
Reputation: 12420
Another option for a simple avatar is django-easy-avatar. It has just has a foreign key relationship to the user table and requires no templates unless you want to override default functionality.
Upvotes: 1
Reputation: 11396
check out django-avatar models.py
66. class Avatar(models.Model):
67. user = models.ForeignKey(getattr(settings, 'AUTH_USER_MODEL', 'auth.User'))
68. ....
the code seem to be ready to accept custom User model, however, you can always git clone and change it as you wish...
Upvotes: 1