diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index c6498f6..6de85cc 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -81,6 +81,10 @@ class AdoptionNotice(models.Model): def animals_list(self): return self.animals.all() + 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)]) + class Animal(models.Model): MALE_NEUTERED = "M_N" diff --git a/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html b/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html index f7ac095..30bbf96 100644 --- a/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html +++ b/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html @@ -3,7 +3,7 @@ {% for adoption_notice in adoption_notices %}
  • -

    {{ adoption_notice.name }}

    +

    {{ adoption_notice.name }}

    Notfellchen: {{ adoption_notice.animals.all|join_link:", " | safe }}