Commit e7b517b9 authored by karin-kurusu's avatar karin-kurusu

Created and implemented "Edit Book Page"

parent c955f3f5
......@@ -14,7 +14,7 @@
<p>{{book.ISBN}}</p>
<p>{{book.blurb}}</p>
<br>
<form action='books/book.get_pk/edit.html' >
<form action='edit' >
<input type="submit" value="Edit Book" />
</form>
<br>
......
{% extends 'base.html' %}
{% load static %}
{% block title %}Edit Book{% endblock %}
{% block content %}
<form action='' method="POST">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save Changes">
</form>
{% endblock %}
\ No newline at end of file
......@@ -27,7 +27,7 @@ class BooksCreate(CreateView):
class BooksUpdate(UpdateView):
model = Books
fields = '__all__'
template_name = 'bookshelf/add-book.html'
template_name = 'bookshelf/edit-book.html'
class AuthorCreate(CreateView):
model = Author
......@@ -37,7 +37,7 @@ class AuthorCreate(CreateView):
class AuthorUpdate(UpdateView):
model = Author
fields = '__all__'
template_name = 'bookshelf/add-author.html'
template_name = 'bookshelf/edit-author.html'
class AuthorList(ListView):
def get(self, request):
......
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