Standardize names for existing models.

This commit is contained in:
Christopher Charbonneau Wells 2017-08-13 12:04:39 -04:00
parent 481ada74f8
commit b4208f4cac
1 changed files with 4 additions and 2 deletions

View File

@ -43,7 +43,8 @@ class Feeding(models.Model):
ordering = ['-start'] ordering = ['-start']
def __str__(self): def __str__(self):
return '{} fed for {}'.format(self.baby, self.duration()) return 'Feeding for {} on {} ({})'.format(
self.baby, self.end.date(), self.duration())
def duration(self): def duration(self):
return duration_string(self.start, self.end) return duration_string(self.start, self.end)
@ -62,7 +63,8 @@ class Sleep(models.Model):
verbose_name_plural = 'Sleep' verbose_name_plural = 'Sleep'
def __str__(self): def __str__(self):
return '{} slept for {}'.format(self.baby, self.duration()) return 'Sleep for {} on {} ({})'.format(
self.baby, self.end.date(), self.duration())
def duration(self): def duration(self):
return duration_string(self.start, self.end) return duration_string(self.start, self.end)