Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
justinreyes_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
Justin Reyes
justinreyes_reading
Commits
f1aafed0
Commit
f1aafed0
authored
Apr 24, 2023
by
justin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: added UpdateView for authors + buttons to edit in DetailViews
parent
4548938f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
0 deletions
+17
-0
urls.cpython-310.pyc
...nreyes_reading/bookshelf/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
...reyes_reading/bookshelf/__pycache__/views.cpython-310.pyc
+0
-0
author_details.html
...reading/bookshelf/templates/bookshelf/author_details.html
+1
-0
book_details.html
...s_reading/bookshelf/templates/bookshelf/book_details.html
+1
-0
edit-author.html
...es_reading/bookshelf/templates/bookshelf/edit-author.html
+7
-0
urls.py
justinreyes_reading/bookshelf/urls.py
+2
-0
views.py
justinreyes_reading/bookshelf/views.py
+6
-0
db.sqlite3
justinreyes_reading/db.sqlite3
+0
-0
No files found.
justinreyes_reading/bookshelf/__pycache__/urls.cpython-310.pyc
View file @
f1aafed0
No preview for this file type
justinreyes_reading/bookshelf/__pycache__/views.cpython-310.pyc
View file @
f1aafed0
No preview for this file type
justinreyes_reading/bookshelf/templates/bookshelf/author_details.html
View file @
f1aafed0
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<li>
{{ object.nationality }}
</li>
<li>
{{ object.nationality }}
</li>
<li>
{{ object.bio }}
</li>
<li>
{{ object.bio }}
</li>
</ul>
</ul>
<a
href=
"./edit"
>
Edit Author
</a>
</div>
</div>
<div
class=
"author-books"
>
<div
class=
"author-books"
>
...
...
justinreyes_reading/bookshelf/templates/bookshelf/book_details.html
View file @
f1aafed0
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<li>
{{ object.isbn }}
</li>
<li>
{{ object.isbn }}
</li>
<li>
{{ object.blurb }}
</li>
<li>
{{ object.blurb }}
</li>
</ul>
</ul>
<a
href=
"./edit"
>
Edit Book
</a>
</div>
</div>
<ul
class=
"footer"
>
<ul
class=
"footer"
>
...
...
justinreyes_reading/bookshelf/templates/bookshelf/edit-author.html
0 → 100644
View file @
f1aafed0
{% extends 'base.html' %}
{% block content %}
<form
method=
"post"
>
{% csrf_token %} {{ form.as_p }}
<input
type=
"submit"
value=
"Update"
/>
</form>
{% endblock %}
justinreyes_reading/bookshelf/urls.py
View file @
f1aafed0
...
@@ -8,6 +8,7 @@ from .views import (
...
@@ -8,6 +8,7 @@ from .views import (
BookUpdateView
,
BookUpdateView
,
AuthorListView
,
AuthorListView
,
AuthorDetailView
,
AuthorDetailView
,
AuthorUpdateView
,
)
)
urlpatterns
=
[
urlpatterns
=
[
...
@@ -19,4 +20,5 @@ urlpatterns = [
...
@@ -19,4 +20,5 @@ urlpatterns = [
path
(
"authors/"
,
AuthorListView
.
as_view
(),
name
=
"author-list"
),
path
(
"authors/"
,
AuthorListView
.
as_view
(),
name
=
"author-list"
),
path
(
"authors/add"
,
add_author
,
name
=
"add-author"
),
path
(
"authors/add"
,
add_author
,
name
=
"add-author"
),
path
(
"authors/<int:pk>/details"
,
AuthorDetailView
.
as_view
(),
name
=
"author-detail"
),
path
(
"authors/<int:pk>/details"
,
AuthorDetailView
.
as_view
(),
name
=
"author-detail"
),
path
(
"authors/<int:pk>/edit"
,
AuthorUpdateView
.
as_view
(),
name
=
"update-author"
),
]
]
justinreyes_reading/bookshelf/views.py
View file @
f1aafed0
...
@@ -66,3 +66,9 @@ class AuthorListView(ListView):
...
@@ -66,3 +66,9 @@ class AuthorListView(ListView):
class
AuthorDetailView
(
DetailView
):
class
AuthorDetailView
(
DetailView
):
model
=
Author
model
=
Author
template_name
=
"bookshelf/author_details.html"
template_name
=
"bookshelf/author_details.html"
class
AuthorUpdateView
(
UpdateView
):
model
=
Author
fields
=
"__all__"
template_name
=
"bookshelf/edit-author.html"
justinreyes_reading/db.sqlite3
View file @
f1aafed0
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