From 8ea161291e296668793e3bcb9d0db803ee5d9b67 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Fri, 6 Aug 2021 16:16:07 +0200 Subject: [PATCH] fix: Update deposits initial migration --- deposits/migrations/0001_initial.py | 4 +++- deposits/models.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deposits/migrations/0001_initial.py b/deposits/migrations/0001_initial.py index 47052f8a..02b03fbd 100644 --- a/deposits/migrations/0001_initial.py +++ b/deposits/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.18 on 2021-08-06 13:10 +# Generated by Django 2.2.18 on 2021-08-06 13:54 from django.conf import settings from django.db import migrations, models @@ -25,6 +25,7 @@ class Migration(migrations.Migration): options={ 'verbose_name': 'deposit item', 'verbose_name_plural': 'deposit items', + 'abstract': False, }, bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), ), @@ -34,6 +35,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('date', models.DateTimeField(auto_now_add=True, verbose_name='date')), ('returned', models.BooleanField(default=False, verbose_name='returned')), + ('deposit_amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='deposit amount')), ('item', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='deposits.DepositItem')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], diff --git a/deposits/models.py b/deposits/models.py index a1edfd3c..09c1f349 100644 --- a/deposits/models.py +++ b/deposits/models.py @@ -50,7 +50,9 @@ class Deposit(RevMixin, AclMixin, models.Model): item = models.ForeignKey("DepositItem", on_delete=models.PROTECT) date = models.DateTimeField(auto_now_add=True, verbose_name=_("date")) returned = models.BooleanField(default=False, verbose_name=_("returned")) - deposit_amount = models.DecimalField(verbose_name=_("deposit amount")) + deposit_amount = models.DecimalField( + max_digits=5, decimal_places=2, verbose_name=_("deposit amount") + ) class Meta: abstract = False