lemoncurry/users/models.py

12 lines
305 B
Python
Raw Normal View History

2017-10-22 18:04:59 -04:00
from django.db import models
from django.contrib.auth.models import AbstractUser
def avatar_path(instance, name):
return 'avatars/{id}/{name}'.format(id=instance.id, name=name)
2017-10-22 18:04:59 -04:00
class User(AbstractUser):
avatar = models.ImageField(upload_to=avatar_path)
2017-10-22 18:04:59 -04:00
note = models.TextField(blank=True)