Commit 682daab8 authored by Jan Enzo Salvador's avatar Jan Enzo Salvador

Fixed the class BooksListView and the class BooksDetailView

parent 80fb2962
...@@ -9,10 +9,15 @@ from .models import Author, Books ...@@ -9,10 +9,15 @@ from .models import Author, Books
# Create your views here. # Create your views here.
def HomepageView(request): def HomepageView(request):
return render(request, 'bookshelf/home.html', { return render(request, 'bookshelf/home.html')
})
class BooksView(View): class BooksListView(ListView):
def get(self, request): model = Books
return render(request, 'bookshelf/books.html') template_name = 'bookshelf/books.html'
# default template is called the books_list.html
class BooksDetailView(DetailView):
model = Books
template_name = 'bookshelf/book_details.html'
# default template is called the books_detail.html
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