Created paths for add and edit functions

parent bdade45c
...@@ -4,10 +4,14 @@ from .views import home ...@@ -4,10 +4,14 @@ from .views import home
urlpatterns = [ urlpatterns = [
path('home/', home, name='home'), path('home/', home, name='home'),
path('home/books/', views.BooksView.as_view(), name='books'), path('home/books/', views.BooksView.as_view(), name="books"),
path('home/authors/', views.AuthorsView.as_view(), name='authors'), path('home/authors/', views.AuthorsView.as_view(), name="authors"),
path('<int:book_id>/book_details', views.BooksDetailView.as_view(), name="book_detail"), path('<int:book_id>/book_details', views.BooksDetailView.as_view(), name="book_detail"),
path('<int:author_id>/author_details', views.AuthorsDetailView.as_view(), name="author_detail"), path('<int:author_id>/author_details', views.AuthorsDetailView.as_view(), name="author_detail"),
path('home/books/add', views.AddBookView.as_view(), name="add_book"),
path('home/authors/add', views.AddAuthorView.as_view(), name="add_author"),
path('books/<int:pk>/edit/', views.BookEditView.as_view(), name="edit_book"),
path('authors/<int:pk>/edit/', views.AuthorEditView.as_view(), name="edit_author"),
] ]
app_name = 'bookshelf' app_name = 'bookshelf'
\ 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