diff options
author | luxagraf <sng@luxagraf.net> | 2018-11-02 15:01:05 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-11-02 15:01:05 -0600 |
commit | 68abc78a9a543697d8f176775a052c1d70e371a4 (patch) | |
tree | 8d440951fa1786d2ac62a3836079a979bb812fae /apps/accounts/models.py |
added some basic user models and tests
Diffstat (limited to 'apps/accounts/models.py')
-rw-r--r-- | apps/accounts/models.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/accounts/models.py b/apps/accounts/models.py new file mode 100644 index 0000000..a930081 --- /dev/null +++ b/apps/accounts/models.py @@ -0,0 +1,20 @@ +from django.db import models +from django.contrib.auth.models import AbstractUser + + +class User(AbstractUser): + pass + + class Meta: + ordering = ['-date_joined'] + + +class UserProfile(models.Model): + user = models.OneToOneField(User, on_delete=models.CASCADE) + photo = models.ImageField(upload_to='profile', null=True, blank=True) + website = models.CharField(max_length=300, null=True, blank=True, default='') + location = models.CharField(max_length=300, null=True, blank=True, default='') + bio = models.TextField(null=True, blank=True, default='') + + def __str__(self): + return self.user.username |