Commit 28f58b1c authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

bookview is done but the books are gone

parent 5511a2d6
{% block title%} My favorite books {% endblock %}
{% block additional %} <h3> Neptune's favorite books</h3> {% endblock %}
{% block content %}
<ol>
{% for obj in object_list %}
<li><a href=obj.get_absolute_url>{{ obj.title }}</a></li>
{% endfor %}
</ol>
<div>
<a href="/home">Home</a>
<a href="/authors">Authors</a>
</div>
{% endblock %}
\ No newline at end of file
......@@ -7,8 +7,8 @@
{% block content %}
<p>My taste in books are very random and usually done in the spur of the moment. I cannot commit to a series. </p>
<div>
<a href="Books/">Books</a>
<a href="Authors/"> Authors</a>
<a href="/books">Books</a>
<a href="/authors"> Authors</a>
</div>
{% endblock %}
......
# bookshelf/urls.py
from django.urls import path
from .views import homeView
from .views import (homeView, BooksView, BooksDetails)
urlpatterns = [
path('home/', homeView, name='home'),
path('books/', BooksView.as_view(), name='books'),
path('books/<int:pk>/details/', BooksDetails.as_view(), name='book-details'),
]
# This might be needed, depending on your Django version
......
......@@ -10,7 +10,7 @@ def homeView(request):
class BooksView(ListView):
model = Books
template_name = 'bookshelf/books.html'
template_name = 'bookshelf/booksView.html'
class BooksDetails(DetailView):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment