feat: Represent last checked more human-readable

This commit is contained in:
2025-01-04 09:48:05 +01:00
parent a8c837e9f6
commit 561a30b7ab
3 changed files with 44 additions and 1 deletions

View File

@@ -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: