Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mattarpas_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
Matthew Karl David P. Arpas
mattarpas_reading
Commits
71da1974
Commit
71da1974
authored
Apr 25, 2023
by
Matthew Karl David P. Arpas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented site redirection after form submission for add-book and add-author
parent
97918615
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
views.cpython-311.pyc
...arpas_reading/bookshelf/__pycache__/views.cpython-311.pyc
+0
-0
views.py
mattarpas_reading/bookshelf/views.py
+5
-1
db.sqlite3
mattarpas_reading/db.sqlite3
+0
-0
No files found.
mattarpas_reading/bookshelf/__pycache__/views.cpython-311.pyc
View file @
71da1974
No preview for this file type
mattarpas_reading/bookshelf/views.py
View file @
71da1974
...
@@ -39,9 +39,11 @@ class AddNewBookView(DetailView):
...
@@ -39,9 +39,11 @@ class AddNewBookView(DetailView):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
form
=
BookForm
(
request
.
POST
)
form
=
BookForm
(
request
.
POST
)
postedauthor
=
Author
.
objects
.
get
(
pk
=
request
.
POST
.
get
(
'author'
))
title
=
request
.
POST
.
get
(
'title'
)
title
=
request
.
POST
.
get
(
'title'
)
author
=
Author
.
objects
.
get
(
request
.
POST
.
get
(
'author'
))
author
=
postedauthor
print
(
author
)
publisher
=
request
.
POST
.
get
(
'publisher'
)
publisher
=
request
.
POST
.
get
(
'publisher'
)
year_published
=
request
.
POST
.
get
(
'year_published'
)
year_published
=
request
.
POST
.
get
(
'year_published'
)
ISBN
=
request
.
POST
.
get
(
'ISBN'
)
ISBN
=
request
.
POST
.
get
(
'ISBN'
)
...
@@ -66,6 +68,8 @@ class AddNewAuthorView(DetailView):
...
@@ -66,6 +68,8 @@ class AddNewAuthorView(DetailView):
return
render
(
request
,
'bookshelf/add-author.html'
,
{
'form'
:
form
})
return
render
(
request
,
'bookshelf/add-author.html'
,
{
'form'
:
form
})
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
form
=
AuthorForm
(
request
.
POST
)
first_name
=
request
.
POST
.
get
(
'first_name'
)
first_name
=
request
.
POST
.
get
(
'first_name'
)
last_name
=
request
.
POST
.
get
(
'last_name'
)
last_name
=
request
.
POST
.
get
(
'last_name'
)
age
=
request
.
POST
.
get
(
'age'
)
age
=
request
.
POST
.
get
(
'age'
)
...
...
mattarpas_reading/db.sqlite3
View file @
71da1974
No preview for this file type
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