Commit 6dd26e0b authored by Ysabella Panghulan's avatar Ysabella Panghulan

added AuthorCreateView class in views.py

parent 300db30f
...@@ -4,6 +4,7 @@ from django.views import View ...@@ -4,6 +4,7 @@ from django.views import View
from django.shortcuts import render from django.shortcuts import render
from django.views.generic.list import ListView from django.views.generic.list import ListView
from django.views.generic.detail import DetailView from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView
# Create your views here. # Create your views here.
def Homepage(request): def Homepage(request):
...@@ -30,3 +31,7 @@ class AuthorListView(ListView): ...@@ -30,3 +31,7 @@ class AuthorListView(ListView):
class AuthorDetailView(DetailView): class AuthorDetailView(DetailView):
model = Author model = Author
template_name = 'bookshelf/author_details.html' template_name = 'bookshelf/author_details.html'
class AuthorCreateView(CreateView):
model = Author
fields = '__all__'
\ No newline at end of file
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