Add UnknownUser

This commit is contained in:
Declerfayt Cedric 2015-12-10 17:30:12 +01:00
parent e2b8bdb957
commit 8e9514c43c
1 changed files with 9 additions and 2 deletions

View File

@ -11,6 +11,10 @@ class AbstractModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class UnkownUser(models.Model):
name = models.CharField(max_length=255)
email = models.CharField(max_length=255)
class Wishlist(AbstractModel):
@ -57,9 +61,12 @@ class Wish(AbstractModel):
percentage = (number_of_linked_parts / total)
return percentage * 100
class Part(models.Model):
wish = models.ForeignKey('Wish')
class WishPart(models.Model):
wish = models.ForeignKey(Wish)
user = models.ForeignKey(User)
unknown_user = models.ForeignKey(UnknownUser)
comment = models.TextField()
done_at = models.DateTimeField()
def save(self, force_insert=False, force_update=False, commit=True):
pass