feat: Reduce card size for map

This commit is contained in:
2024-09-27 16:34:44 +02:00
parent b91879ad6c
commit 26406ded52
4 changed files with 43 additions and 1 deletions

View File

@@ -186,6 +186,11 @@ class AdoptionNotice(models.Model):
else:
return self.location.latitude, self.location.longitude
@property
def description_short(self):
if len(self.description) > 200:
return self.description[:200] + f" ... [weiterlesen]({self.get_absolute_url()})"
def get_absolute_url(self):
"""Returns the url to access a detailed page for the animal."""
return reverse('adoption-notice-detail', args=[str(self.id)])