Commit bdbd3cf4 authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

restored the html files.

parent 5f93991c
...@@ -10,6 +10,8 @@ class Author(models.Model): ...@@ -10,6 +10,8 @@ class Author(models.Model):
def __str__(self): def __str__(self):
return "{} {}".format(self.first_name, self.last_name) return "{} {}".format(self.first_name, self.last_name)
class Book(models.Model): class Book(models.Model):
......
# bookshelf/urls.py # bookshelf/urls.py
from django.urls import path from django.urls import path
from .views import index from .views import (homeView, BooksView, BooksDetail)
urlpatterns = [ urlpatterns = [
path('', index, name='index'), path('home/', homeView, name='home'),
path('books/', BooksView.as_view(), name="books"),
path('books/<int:pk>/details', BooksDetail.as_view(), name="book_details")
] ]
# This might be needed, depending on your Django version # This might be needed, depending on your Django version
......
from django.shortcuts import render from django.shortcuts import render
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from .models import Author, Book
# Create your views here. def homeView(request):
return render(request, 'home.html')
class BooksView(ListView):
model = Book
template_name = "bookshelf/books.html"
class BooksDetail(DetailView):
model = Book
template_name = "bookshelf/bookDetais.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