added user profile page
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -2,6 +2,19 @@ from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
|
||||
|
||||
class UserProfile(models.Model):
|
||||
DARK = 'dark'
|
||||
LIGHT = 'light'
|
||||
THEME_CHOICES = [(DARK, 'Dark'), (LIGHT, 'Light')]
|
||||
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
|
||||
display_name = models.CharField(max_length=100, blank=True)
|
||||
theme = models.CharField(max_length=10, choices=THEME_CHOICES, default=DARK)
|
||||
|
||||
def __str__(self):
|
||||
return f"Profile({self.user.username})"
|
||||
|
||||
|
||||
class Item(models.Model):
|
||||
GAMES = 'games'
|
||||
BOOKS = 'books'
|
||||
|
||||
Reference in New Issue
Block a user