Commit 8b439c93 authored by Jan Ericsson Ong Ang's avatar Jan Ericsson Ong Ang

updated home.html

parent 48c462f1
...@@ -6,6 +6,7 @@ from .models import Author, Books ...@@ -6,6 +6,7 @@ from .models import Author, Books
# Create your views here. # Create your views here.
#FBV
def HomeView(request): def HomeView(request):
return render(request, 'bookshelf/home.html', {'nickname': 'Jan'}) return render(request, 'bookshelf/home.html', {'nickname': 'Jan'})
...@@ -16,6 +17,7 @@ class AuthorView(ListView): ...@@ -16,6 +17,7 @@ class AuthorView(ListView):
author_data = Author.objects.all().values() author_data = Author.objects.all().values()
return render(request, 'bookshelf/authors.html', {'nickname': 'Jan', 'author_data': author_data}) return render(request, 'bookshelf/authors.html', {'nickname': 'Jan', 'author_data': author_data})
#CBV
class AuthorDetailView(DetailView): class AuthorDetailView(DetailView):
pk_url_kwarg = 'id' pk_url_kwarg = 'id'
model = Author model = Author
......
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