flake 8 compliance + fix wish/item bug
This commit is contained in:
parent
a87f3982e9
commit
683729be29
|
@ -3,13 +3,15 @@ from django.contrib.auth.models import User
|
|||
|
||||
import uuid
|
||||
|
||||
|
||||
class Wishlist(models.Model):
|
||||
|
||||
name = models.CharField(max_length=255)
|
||||
description = models.TextField()
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
external_id = models.UUIDField(unique=True, default=uuid.uuid4, editable=False)
|
||||
external_id = models.UUIDField(unique=True, default=uuid.uuid4,
|
||||
editable=False)
|
||||
|
||||
@staticmethod
|
||||
def create(name, description):
|
||||
|
@ -19,6 +21,7 @@ class Wishlist(models.Model):
|
|||
w.save()
|
||||
return w
|
||||
|
||||
|
||||
class Wish(models.Model):
|
||||
|
||||
wishlist = models.ForeignKey(Wishlist, related_name='items')
|
||||
|
@ -30,17 +33,21 @@ class Wish(models.Model):
|
|||
numbers_available = models.IntegerField(default=1)
|
||||
number_of_parts = models.IntegerField(null=True)
|
||||
estimated_price = models.DecimalField(max_digits=19, decimal_places=2,
|
||||
null=True)
|
||||
null=True)
|
||||
|
||||
@staticmethod
|
||||
def create(name, description, wishlist):
|
||||
i = Item()
|
||||
i = Wish()
|
||||
i.name = name
|
||||
i.description = description
|
||||
i.wishlist = wishlist
|
||||
i.save()
|
||||
return i
|
||||
|
||||
|
||||
class Part(models.Model):
|
||||
wish = models.ForeignKey('Wish')
|
||||
user = models.ForeignKey(User)
|
||||
|
||||
def save(self, force_insert=False, force_update=False, commit=True):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue