aboutsummaryrefslogtreecommitdiff
path: root/apps/accounts/models.py
blob: 5ed7634a5fc8c6bd70a0d1ccea165530311d1ba3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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='')
    #default_note_public = models.BooleanField(default=False)
    #default_note_folder = models.ForeignKey('notes.Folder', null=True, on_delete=models.SET_NULL)

    def __str__(self):
        return self.user.username