You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
449 B

from django.shortcuts import render
from novinky.models import Novinka
# Create your views here.
def index(request):
novinky = Novinka.objects.all()
context = {
"novinky": novinky,
}
return render(request, "novinky/index.html", context)
def newitem(request, new_id):
novinka = Novinka.objects.get(id=new_id)
context = {
"novinka": novinka,
}
return render(request, "novinky/newitem.html", context)