diff --git a/core/forms.py b/core/forms.py index 3aca09c4..024b9abd 100644 --- a/core/forms.py +++ b/core/forms.py @@ -90,7 +90,7 @@ class ChildDeleteForm(forms.ModelForm): class DiaperChangeForm(forms.ModelForm): class Meta: model = models.DiaperChange - fields = ['child', 'time', 'wet', 'solid', 'color'] + fields = ['child', 'time', 'wet', 'solid', 'color', 'amount'] widgets = { 'time': forms.DateTimeInput(attrs={ 'class': 'datetimepicker-input', diff --git a/core/migrations/0009_diaperchange_amount.py b/core/migrations/0009_diaperchange_amount.py new file mode 100644 index 00000000..991260de --- /dev/null +++ b/core/migrations/0009_diaperchange_amount.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.2 on 2020-01-26 21:11 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0008_auto_20190607_1422'), + ] + + operations = [ + migrations.AddField( + model_name='diaperchange', + name='amount', + field=models.FloatField(blank=True, null=True, verbose_name='Amount'), + ), + ] diff --git a/core/models.py b/core/models.py index f58247e8..debc2354 100644 --- a/core/models.py +++ b/core/models.py @@ -139,6 +139,7 @@ class DiaperChange(models.Model): max_length=255, verbose_name=_('Color') ) + amount = models.FloatField(blank=True, null=True, verbose_name=_('Amount')) objects = models.Manager() diff --git a/core/templates/core/diaperchange_list.html b/core/templates/core/diaperchange_list.html index d8cd1e7a..dfb8ffa9 100644 --- a/core/templates/core/diaperchange_list.html +++ b/core/templates/core/diaperchange_list.html @@ -18,6 +18,7 @@