feat: Add basic embeddable view for ans of rescue orgs

This commit is contained in:
2025-09-10 17:44:33 +02:00
parent df15ea100b
commit 5a2b11b44e
9 changed files with 120 additions and 4 deletions

View File

@@ -421,6 +421,13 @@ class AdoptionNotice(models.Model):
num_per_sex[sex] = self.animals.filter(sex=sex).count()
return num_per_sex
@property
def species(self):
species = set()
for animal in self.animals:
species.add(animal.species)
return species
@property
def last_checked_hr(self):
time_since_last_checked = timezone.now() - self.last_checked
@@ -466,7 +473,6 @@ class AdoptionNotice(models.Model):
def description_100_short(self):
return self._get_short_description(90)
def get_absolute_url(self):
"""Returns the url to access a detailed page for the adoption notice."""
return reverse('adoption-notice-detail', args=[str(self.id)])