Commit edf0e30e authored by Trisha Angel Millena's avatar Trisha Angel Millena

Edited views.py and add-book.html

parent 76cee439
......@@ -3,18 +3,15 @@
{% load static %}
{% block title %}Add New Book{% endblock %}
<form method = "POST">
{% csrf_token % }
{% for field in form%}
{% block content %}
{% endform %}
<form method = "POST">
{% csrf_token % }
{{ form.as_p }}
<input type = "submit" value = "Add Book" />
</form>
{% block content %}
{% endblock %}
......@@ -3,6 +3,7 @@ from django.views import View
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import Author, Books
from django.views.generic.edit import CreateView, UpdateView
# Create your views here.
......@@ -23,4 +24,10 @@ class AuthorListView(ListView):
class AuthorDetailView(DetailView):
model = Author
template_name = 'bookshelf/author_details.html'
\ No newline at end of file
template_name = 'bookshelf/author_details.html'
class BookCreateView(CreateView):
model = Book
fields = "__all__"
template_name = 'bookshelf/add-book.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