From 97ab2312318ca2679498c9ef3de8a3d4e7b1d0fe Mon Sep 17 00:00:00 2001 From: Kaibu Date: Thu, 14 Nov 2019 00:12:07 +0100 Subject: [PATCH] fixed decimalfield --- cookbook/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/models.py b/cookbook/models.py index d979184f7..44d8d8f83 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -73,7 +73,7 @@ class Recipe(models.Model): class RecipeIngredients(models.Model): recipe = models.ForeignKey(Recipe, on_delete=models.CASCADE) unit = models.CharField(max_length=128) - amount = models.DecimalField(default=0) + amount = models.DecimalField(default=0, decimal_places=2, max_digits=16) ingredient = models.ForeignKey(Ingredients, models.PROTECT)