Mislykka forsøk på å sette hylle per kategori.
This commit is contained in:
parent
00ae89ce63
commit
8d1cdba906
|
@ -74,7 +74,7 @@ def CategoryIndex(request):
|
||||||
def CategoryView(request,category_identifier):
|
def CategoryView(request,category_identifier):
|
||||||
category = get_object_or_404(Category,id=category_identifier)
|
category = get_object_or_404(Category,id=category_identifier)
|
||||||
book_list = category.book_set.all()
|
book_list = category.book_set.all()
|
||||||
return render_to_response('category/view.html', {'category': category, 'book_list': book_list})
|
return render_to_response('category/view.html', {'category': category, 'book_list': book_list})
|
||||||
|
|
||||||
def IndexView(request):
|
def IndexView(request):
|
||||||
return render_to_response('index.html', {'categories': Category.objects.all().order_by('name')})
|
return render_to_response('index.html', {'categories': Category.objects.all().order_by('name')})
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
|
|
||||||
<h2>{{ category }}</h2>
|
<h2>{{ category }}</h2>
|
||||||
|
|
||||||
{% if not book_list %}
|
{% if book_list %}
|
||||||
Det finnes ingen bøker i denne kategorien.
|
|
||||||
{% else %}
|
|
||||||
<div class="key">Bøker:</div>
|
<div class="key">Bøker:</div>
|
||||||
<ul>
|
<ul>
|
||||||
{% for book in book_list %}
|
{% for book in book_list %}
|
||||||
|
|
Reference in New Issue