From 3e0d0cf855201bc14a060043db880c097f853cdf Mon Sep 17 00:00:00 2001 From: moanos Date: Mon, 18 Mar 2024 14:21:42 +0100 Subject: [PATCH] feat(ui): Show adoption notices --- src/fellchensammlung/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index d178ea2..90f19ac 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -1,10 +1,13 @@ from django.shortcuts import render from django.http import HttpResponse +from fellchensammlung.models import AdoptionNotice def index(request): - return HttpResponse("Hello, world. Look at all the little guys&girls and non-binary pals!") + latest_adoption_list = AdoptionNotice.objects.order_by("-created_at")[:5] + output = ", ".join([q.name for q in latest_adoption_list]) + return HttpResponse(output) def adoption_notice_detail(request, adoption_notice_id):