Browse Source

detail novinky hotovo

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

9
novinky/templates/novinky/novinka.html

@ -3,8 +3,13 @@
{% block content %} {% 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> <a href="{% url 'index' %}">zpět</a>
{% endblock %}
{% endblock %}

6
novinky/views.py

@ -13,5 +13,7 @@ def index(request):
def novinka(request, novinka_id): 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