diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index 7a56f30..4e4dca0 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -12,6 +12,7 @@ from django.contrib.auth.models import AbstractUser from .tools import misc, geo from notfellchen.settings import MEDIA_URL from .tools.geo import LocationProxy +from .tools.misc import age_as_hr_string, time_since_as_hr_string class Language(models.Model): @@ -257,6 +258,13 @@ class AdoptionNotice(models.Model): sexes.add(animal.sex) return sexes + @property + def last_checked_hr(self): + time_since_last_checked = timezone.now() - self.last_checked + print(time_since_as_hr_string(time_since_last_checked)) + return time_since_as_hr_string(time_since_last_checked) + + def sex_code(self): # Treat Intersex as mixed in order to increase their visibility if len(self.sexes) > 1: diff --git a/src/fellchensammlung/templates/fellchensammlung/details/detail_adoption_notice.html b/src/fellchensammlung/templates/fellchensammlung/details/detail_adoption_notice.html index ece3099..b8bd9ba 100644 --- a/src/fellchensammlung/templates/fellchensammlung/details/detail_adoption_notice.html +++ b/src/fellchensammlung/templates/fellchensammlung/details/detail_adoption_notice.html @@ -77,7 +77,8 @@