feat: further redesign

This commit is contained in:
2025-05-01 18:15:25 +02:00
parent 99cde15966
commit 4c9c1e13a5
2 changed files with 67 additions and 54 deletions

View File

@@ -316,6 +316,13 @@ class AdoptionNotice(models.Model):
sexes.add(animal.sex)
return sexes
@property
def num_per_sex(self):
num_per_sex = dict()
for sex in SexChoices:
num_per_sex[sex] = self.animals.filter(sex=sex).count
return num_per_sex
@property
def last_checked_hr(self):
time_since_last_checked = timezone.now() - self.last_checked