Commit c8fd077f authored by Ysabella Panghulan's avatar Ysabella Panghulan

added BookUpdateView class in views.py

parent 9bea7bba
...@@ -42,6 +42,10 @@ class BooksCreateView(CreateView): ...@@ -42,6 +42,10 @@ class BooksCreateView(CreateView):
} }
return render(request, 'bookshelf/add-book.html', context) return render(request, 'bookshelf/add-book.html', context)
class BookUpdateView(UpdateView):
model = Books
fields = '__all__'
template_name = 'bookshelf/edit-book.html'
class AuthorListView(ListView): class AuthorListView(ListView):
model = Author model = Author
...@@ -71,5 +75,4 @@ class AuthorCreateView(CreateView): ...@@ -71,5 +75,4 @@ class AuthorCreateView(CreateView):
class AuthorUpdateView(UpdateView): class AuthorUpdateView(UpdateView):
model = Author model = Author
fields = '__all__' fields = '__all__'
template_name = 'bookshelf/edit-author.html' template_name = 'bookshelf/edit-author.html'
\ 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