Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trishamillena_reading
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Trisha Angel Millena
trishamillena_reading
Commits
edf0e30e
Commit
edf0e30e
authored
Apr 25, 2023
by
Trisha Angel Millena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edited views.py and add-book.html
parent
76cee439
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
add-book.html
...llena_reading/bookshelf/templates/bookshelf/add-book.html
+4
-7
views.py
trishamillena_reading/bookshelf/views.py
+8
-1
No files found.
trishamillena_reading/bookshelf/templates/bookshelf/add-book.html
View file @
edf0e30e
...
...
@@ -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 %}
trishamillena_reading/bookshelf/views.py
View file @
edf0e30e
...
...
@@ -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'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment