added support for user profiles
This commit is contained in:
parent
eeb74027eb
commit
1f314f1c20
8 changed files with 137 additions and 32 deletions
|
@ -1,3 +1,12 @@
|
|||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
|
||||
|
||||
# Create your models here.
|
||||
class UserProfile(models.Model):
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=100, null=True, blank=True)
|
||||
|
||||
@property
|
||||
def lists(self):
|
||||
return self.user.movielist_set.all()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue