From d957e643c9895f05ca53461a29c9ed4b1bce9d6e Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 19 Jul 2019 10:12:46 +0200 Subject: [PATCH] Simplify transaction model --- note/models/transactions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/note/models/transactions.py b/note/models/transactions.py index e27b3e11..c2d0135d 100644 --- a/note/models/transactions.py +++ b/note/models/transactions.py @@ -55,8 +55,9 @@ class Transaction(models.Model): verbose_name=_('created at'), default=timezone.now, ) - quantity = models.PositiveSmallIntegerField( + quantity = models.PositiveIntegerField( verbose_name=_('quantity'), + default=1, ) amount = models.PositiveIntegerField( verbose_name=_('amount'), @@ -69,8 +70,9 @@ class Transaction(models.Model): verbose_name=_('reason'), max_length=255, ) - valid = models.NullBooleanField( + valid = models.BooleanField( verbose_name=_('valid'), + default=True, ) class Meta: