feat(ui): Add basic index site

This commit is contained in:
moanos [he/him] 2024-03-18 14:53:31 +01:00
parent 5602e31469
commit 93de1e2dfb

View File

@ -5,9 +5,11 @@ from fellchensammlung.models import AdoptionNotice
def index(request): def index(request):
"""View function for home page of site."""
latest_adoption_list = AdoptionNotice.objects.order_by("-created_at")[:5] latest_adoption_list = AdoptionNotice.objects.order_by("-created_at")[:5]
output = ", ".join([q.name for q in latest_adoption_list]) context = {"latest_adoptions": latest_adoption_list}
return HttpResponse(output)
return render(request, 'fellchensammlung/index.html', context=context)
def adoption_notice_detail(request, adoption_notice_id): def adoption_notice_detail(request, adoption_notice_id):