updated pumping fake data for start/end/duration

This commit is contained in:
John Merlie 2023-06-16 17:12:18 -04:00 committed by Christopher Charbonneau Wells
parent e56ff48128
commit 7918b9aca8
1 changed files with 7 additions and 3 deletions

View File

@ -145,9 +145,13 @@ class Command(BaseCommand):
if choice([True, False, False, False]): if choice([True, False, False, False]):
notes = " ".join(self.faker.sentences(randint(1, 5))) notes = " ".join(self.faker.sentences(randint(1, 5)))
models.Pumping.objects.create( start = self.time + timedelta(minutes=randint(1, 60))
child=self.child, amount=self.amount, time=self.time, notes=notes end = start + timedelta(minutes=randint(5, 20))
).save()
if end < self.time_now:
models.Pumping.objects.create(
child=self.child, amount=self.amount, start=start, end=end, notes=notes
).save()
@transaction.atomic @transaction.atomic
def _add_diaperchange_entry(self): def _add_diaperchange_entry(self):