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

Updated "Book's Details Page" to have an "Edit Book" button

parent b5b638cc
......@@ -13,6 +13,11 @@
<p>{{book.year_published}}</p>
<p>{{book.ISBN}}</p>
<p>{{book.blurb}}</p>
<br>
<form action='books/book.get_pk/edit.html' >
<input type="submit" value="Edit Book" />
</form>
<br>
{% endblock %}
{% block navbar %}
......
from django.urls import path
from .views import home, BooksList, BooksDetails, AuthorList, AuthorDetails, BooksCreate, AuthorCreate
from .views import home, BooksList, BooksDetails, AuthorList, AuthorDetails, BooksCreate, AuthorCreate, BooksUpdate
urlpatterns = [
path('home/', home, name='home'),
path('books/', BooksList.as_view(), name='books'),
path('books/<int:pk>/details', BooksDetails.as_view(), name='book_detais'),
path('books/add', BooksCreate.as_view(), name='add-book'),
path('books/<int:pk>/edit', BooksUpdate.as_view(), name='edit-book'),
path('authors/', AuthorList.as_view(), name="authors"),
path('authors/<int:pk>/details', AuthorDetails.as_view(), name='author_details'),
path('authors/add', AuthorCreate.as_view(), name='add-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