Browse Source

detail novinky hotovo

master
Jméno Příjmení 3 years ago
parent
commit
7f10b378f2
  1. 7
      novinky/templates/novinky/novinka.html
  2. 6
      novinky/views.py

7
novinky/templates/novinky/novinka.html

@ -3,7 +3,12 @@
{% block content %}
Toto je novinka
<h1>{{ novinka.titulek }}</h1>
{{ novinka.autor }} <br>
{{ novinka.datum }} <br>
<p>
{{ novinka.zprava }}
</p>
<a href="{% url 'index' %}">zpět</a>

6
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)

Loading…
Cancel
Save