Skip to content
Snippets Groups Projects
Commit f22e788c authored by Lukas Schneider's avatar Lukas Schneider
Browse files

Add default value for product.stock

parent 28296eda
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ class UserIdentifier(models.Model):
class Product(models.Model):
name = models.TextField(null=False)
category = models.ForeignKey('productcategory', on_delete=models.CASCADE, related_name="products")
stock = models.IntegerField(null=False)
stock = models.IntegerField(null=False, default=0)
price = models.DecimalField(max_digits=6, decimal_places=2)
def updateStock(self, amount):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment