Add: UserProfile model
This commit is contained in:
parent
aeb8e2842d
commit
c86fbb8362
1 changed files with 13 additions and 0 deletions
|
@ -1,2 +1,15 @@
|
|||
from django.db import models
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class UserProfile(models.Model):
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE, unique=True)
|
||||
show_mature = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "User Profile"
|
||||
verbose_name_plural = "User Profiles"
|
||||
|
||||
def __str__(self):
|
||||
return self.user.username
|
||||
|
|
Loading…
Add table
Reference in a new issue