Commit 3742bac9 authored by Ysabella Panghulan's avatar Ysabella Panghulan

added AuthorUpdateView class

parent b2da419a
...@@ -4,7 +4,7 @@ from django.views import View ...@@ -4,7 +4,7 @@ from django.views import View
from django.shortcuts import render, redirect from django.shortcuts import render, redirect
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 from django.views.generic.edit import CreateView, UpdateView
from .forms import AuthorForm, BookForm from .forms import AuthorForm, BookForm
# Create your views here. # Create your views here.
...@@ -67,3 +67,9 @@ class AuthorCreateView(CreateView): ...@@ -67,3 +67,9 @@ class AuthorCreateView(CreateView):
'form': form 'form': form
} }
return render(request, 'bookshelf/add-author.html', context) return render(request, 'bookshelf/add-author.html', context)
class AuthorUpdateView(UpdateView):
model = Author
fields = '__all__'
template_name = 'bookshelf/edit-author.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