Now using "templates" as our template dir name.
[toast/alpenzoo.git] / animals / views.py
index fb5637ea7922929a1c2bb53630cb771e4e3b48c9..48da423e0d44e397e3f49bcfcda1151a5d1022bc 100644 (file)
@@ -7,7 +7,8 @@ def index(request):
     return HttpResponse("Hello, world. You're at the animals index.")
 
 
-def detail(request, animal_id):
+def detail(request, animal_name):
     # return HttpResponse("Hello, world. You're at the animal {}.".format(animal_id))
-    animal = get_object_or_404(Animal, pk=animal_id)
+    animal = get_object_or_404(Animal, name_german=animal_name)
+
     return render(request, 'animals/detail.html', {'animal': animal})