add relation w/ user

This commit is contained in:
Fred 2015-12-06 20:36:14 +01:00
parent 8e2ae12f0c
commit f1cbde2951
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
from django.db import models
from django.contrib.auth.models import User
import uuid
@ -18,7 +19,7 @@ class Wishlist(models.Model):
w.save()
return w
class Item(models.Model):
class Wish(models.Model):
wishlist = models.ForeignKey(Wishlist, related_name='items')
name = models.CharField(max_length=255)
@ -41,4 +42,5 @@ class Item(models.Model):
return i
class Part(models.Model):
pass
wish = models.ForeignKey('Wish')
user = models.ForeignKey(User)