From 93de1e2dfb0fcae982c26dd45f4a0322fe4f29b0 Mon Sep 17 00:00:00 2001 From: moanos Date: Mon, 18 Mar 2024 14:53:31 +0100 Subject: [PATCH] feat(ui): Add basic index site --- src/fellchensammlung/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 90f19ac..1381fde 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -5,9 +5,11 @@ from fellchensammlung.models import AdoptionNotice def index(request): + """View function for home page of site.""" latest_adoption_list = AdoptionNotice.objects.order_by("-created_at")[:5] - output = ", ".join([q.name for q in latest_adoption_list]) - return HttpResponse(output) + context = {"latest_adoptions": latest_adoption_list} + + return render(request, 'fellchensammlung/index.html', context=context) def adoption_notice_detail(request, adoption_notice_id):