Add general notes to most models

This commit is contained in:
Christopher C. Wells 2020-02-14 20:10:08 -08:00 committed by Christopher Charbonneau Wells
parent a449de0be4
commit 48a0093700
3 changed files with 48 additions and 5 deletions

View File

@ -119,7 +119,7 @@ class ChildDeleteForm(forms.ModelForm):
class DiaperChangeForm(CoreModelForm):
class Meta:
model = models.DiaperChange
fields = ['child', 'time', 'wet', 'solid', 'color', 'amount']
fields = ['child', 'time', 'wet', 'solid', 'color', 'amount', 'notes']
widgets = {
'time': forms.DateTimeInput(attrs={
'readonly': 'readonly',
@ -131,7 +131,7 @@ class DiaperChangeForm(CoreModelForm):
class FeedingForm(CoreModelForm):
class Meta:
model = models.Feeding
fields = ['child', 'start', 'end', 'type', 'method', 'amount']
fields = ['child', 'start', 'end', 'type', 'method', 'amount', 'notes']
widgets = {
'start': forms.DateTimeInput(attrs={
'readonly': 'readonly',
@ -153,7 +153,7 @@ class NoteForm(CoreModelForm):
class SleepForm(CoreModelForm):
class Meta:
model = models.Sleep
fields = ['child', 'start', 'end']
fields = ['child', 'start', 'end', 'notes']
widgets = {
'start': forms.DateTimeInput(attrs={
'readonly': 'readonly',
@ -169,7 +169,7 @@ class SleepForm(CoreModelForm):
class TemperatureForm(CoreModelForm):
class Meta:
model = models.Temperature
fields = ['child', 'temperature', 'time']
fields = ['child', 'temperature', 'time', 'notes']
widgets = {
'time': forms.DateTimeInput(attrs={
'readonly': 'readonly',
@ -219,7 +219,7 @@ class TummyTimeForm(CoreModelForm):
class WeightForm(CoreModelForm):
class Meta:
model = models.Weight
fields = ['child', 'weight', 'date']
fields = ['child', 'weight', 'date', 'notes']
widgets = {
'date': forms.DateInput(attrs={
'readonly': 'readonly',

View File

@ -0,0 +1,38 @@
# Generated by Django 3.0.3 on 2020-02-15 03:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0010_timer_child'),
]
operations = [
migrations.AddField(
model_name='diaperchange',
name='notes',
field=models.TextField(blank=True, null=True, verbose_name='Notes'),
),
migrations.AddField(
model_name='feeding',
name='notes',
field=models.TextField(blank=True, null=True, verbose_name='Notes'),
),
migrations.AddField(
model_name='sleep',
name='notes',
field=models.TextField(blank=True, null=True, verbose_name='Notes'),
),
migrations.AddField(
model_name='temperature',
name='notes',
field=models.TextField(blank=True, null=True, verbose_name='Notes'),
),
migrations.AddField(
model_name='weight',
name='notes',
field=models.TextField(blank=True, null=True, verbose_name='Notes'),
),
]

View File

@ -153,6 +153,7 @@ class DiaperChange(models.Model):
verbose_name=_('Color')
)
amount = models.FloatField(blank=True, null=True, verbose_name=_('Amount'))
notes = models.TextField(blank=True, null=True, verbose_name=_('Notes'))
objects = models.Manager()
@ -227,6 +228,7 @@ class Feeding(models.Model):
verbose_name=_('Method')
)
amount = models.FloatField(blank=True, null=True, verbose_name=_('Amount'))
notes = models.TextField(blank=True, null=True, verbose_name=_('Notes'))
objects = models.Manager()
@ -310,6 +312,7 @@ class Sleep(models.Model):
null=True,
verbose_name=_('Duration')
)
notes = models.TextField(blank=True, null=True, verbose_name=_('Notes'))
objects = models.Manager()
naps = NapsManager()
@ -362,6 +365,7 @@ class Temperature(models.Model):
null=False,
verbose_name=_('Time')
)
notes = models.TextField(blank=True, null=True, verbose_name=_('Notes'))
objects = models.Manager()
@ -552,6 +556,7 @@ class Weight(models.Model):
null=False,
verbose_name=_('Date')
)
notes = models.TextField(blank=True, null=True, verbose_name=_('Notes'))
objects = models.Manager()