From 7f10b378f26afbeec34cdeff28b1d8922016343d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jmeno=20P=C5=99=C3=ADjmen=C3=AD?= Date: Fri, 3 Dec 2021 09:18:42 +0100 Subject: [PATCH] detail novinky hotovo --- novinky/templates/novinky/novinka.html | 9 +++++++-- novinky/views.py | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/novinky/templates/novinky/novinka.html b/novinky/templates/novinky/novinka.html index 2dc7467..d378f7a 100644 --- a/novinky/templates/novinky/novinka.html +++ b/novinky/templates/novinky/novinka.html @@ -3,8 +3,13 @@ {% block content %} -Toto je novinka +

{{ novinka.titulek }}

+{{ novinka.autor }}
+{{ novinka.datum }}
+

+ {{ novinka.zprava }} +

zpět -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/novinky/views.py b/novinky/views.py index 1778bd7..4ba6e7a 100644 --- a/novinky/views.py +++ b/novinky/views.py @@ -13,5 +13,7 @@ def index(request): def novinka(request, novinka_id): - - return render(request, "novinky/novinka.html") + context = { + "novinka": Novinka.objects.get(id=novinka_id), + } + return render(request, "novinky/novinka.html", context)