feat: Add basic embeddable view for ans of rescue orgs
This commit is contained in:
@@ -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)])
|
||||
|
Reference in New Issue
Block a user