Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mavlee_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
Mavrick Jordan Lee
mavlee_reading
Commits
41553be2
Commit
41553be2
authored
Apr 24, 2023
by
Mavrick Jordan Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated AuthorDetailsPage. Added EditAuthorPage.
parent
2b1f993b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
2 deletions
+20
-2
author_details.html
...reading/bookshelf/templates/bookshelf/author_details.html
+3
-0
edit-author.html
...ee_reading/bookshelf/templates/bookshelf/edit-author.html
+9
-0
urls.py
mavlee_reading/bookshelf/urls.py
+2
-1
views.py
mavlee_reading/bookshelf/views.py
+6
-1
db.sqlite3
mavlee_reading/db.sqlite3
+0
-0
No files found.
mavlee_reading/bookshelf/templates/bookshelf/author_details.html
View file @
41553be2
...
...
@@ -6,6 +6,9 @@
{{ object.age }}
<br>
{{ object.nationality }}
<br>
{{ object.bio }}
<br>
<a
href=
"{% url 'bookshelf:edit-author' author.id %}"
>
<button>
Edit Author
</button>
</a><br>
Books by {{ object.first_name }} {{ object.last_name }} I love:
</p>
<ul>
...
...
mavlee_reading/bookshelf/templates/bookshelf/edit-author.html
0 → 100644
View file @
41553be2
{% extends 'base.html' %}
{% block title %}Edit Author{% endblock %}
{% block content %}
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"Submit"
value=
"Save Changes"
>
</form>
{% endblock %}
\ No newline at end of file
mavlee_reading/bookshelf/urls.py
View file @
41553be2
...
...
@@ -3,7 +3,7 @@ from django.urls import path
from
.
import
views
from
.views
import
(
BooksListView
,
BookDetailsView
,
AuthorsListView
,
AuthorDetailsView
,
BookCreateView
,
AuthorCreateView
,
BookUpdateView
BookCreateView
,
AuthorCreateView
,
BookUpdateView
,
AuthorUpdateView
)
urlpatterns
=
[
...
...
@@ -15,6 +15,7 @@ urlpatterns = [
path
(
'books/add/'
,
BookCreateView
.
as_view
(),
name
=
"add-book"
),
path
(
'authors/add/'
,
AuthorCreateView
.
as_view
(),
name
=
"add-author"
),
path
(
'books/<int:pk>/edit/'
,
BookUpdateView
.
as_view
(),
name
=
"edit-book"
),
path
(
'authors/<int:pk>/edit/'
,
AuthorUpdateView
.
as_view
(),
name
=
"edit-author"
),
]
app_name
=
'bookshelf'
\ No newline at end of file
mavlee_reading/bookshelf/views.py
View file @
41553be2
...
...
@@ -39,4 +39,9 @@ class AuthorCreateView(CreateView):
class
BookUpdateView
(
UpdateView
):
model
=
Book
fields
=
'__all__'
template_name
=
'bookshelf/edit-book.html'
\ No newline at end of file
template_name
=
'bookshelf/edit-book.html'
class
AuthorUpdateView
(
UpdateView
):
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/edit-author.html'
\ No newline at end of file
mavlee_reading/db.sqlite3
View file @
41553be2
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