Remove unused "since" model methods.

This "to string" functionality is and should be handled in templates.
This commit is contained in:
Christopher Charbonneau Wells 2017-10-25 09:19:14 -04:00
parent b393de90dc
commit e3b0fc2468
1 changed files with 1 additions and 16 deletions

View File

@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db import models from django.db import models
from django.template.defaultfilters import slugify from django.template.defaultfilters import slugify
from django.utils import timezone, timesince from django.utils import timezone
class Child(models.Model): class Child(models.Model):
@ -56,9 +56,6 @@ class DiaperChange(models.Model):
def __str__(self): def __str__(self):
return 'Diaper Change' return 'Diaper Change'
def since(self, time=timezone.now()):
return timesince.timesince(self.time, time)
def attributes(self): def attributes(self):
attributes = [] attributes = []
if self.wet: if self.wet:
@ -96,9 +93,6 @@ class Feeding(models.Model):
def __str__(self): def __str__(self):
return 'Feeding' return 'Feeding'
def since(self, time=timezone.now()):
return timesince.timesince(self.end, time)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
if self.start and self.end: if self.start and self.end:
self.duration = self.end - self.start self.duration = self.end - self.start
@ -120,9 +114,6 @@ class Note(models.Model):
def __str__(self): def __str__(self):
return 'Note' return 'Note'
def since(self, time=timezone.now()):
return timesince.timesince(self.time, time)
class Sleep(models.Model): class Sleep(models.Model):
model_name = 'sleep' model_name = 'sleep'
@ -141,9 +132,6 @@ class Sleep(models.Model):
def __str__(self): def __str__(self):
return 'Sleep' return 'Sleep'
def since(self, time=timezone.now()):
return timesince.timesince(self.end, time)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
if self.start and self.end: if self.start and self.end:
self.duration = self.end - self.start self.duration = self.end - self.start
@ -217,9 +205,6 @@ class TummyTime(models.Model):
def duration_td(self): def duration_td(self):
return self.end - self.start return self.end - self.start
def since(self, time=timezone.now()):
return timesince.timesince(self.end, time)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
if self.start and self.end: if self.start and self.end:
self.duration = self.end - self.start self.duration = self.end - self.start