Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
migs_atienza_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
Migs Atienza
migs_atienza_reading
Commits
4fa16fd3
Commit
4fa16fd3
authored
May 01, 2023
by
Migs Atienza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added edit author html + edit author button
parent
5afc3fc9
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
4 deletions
+36
-4
urls.cpython-39.pyc
...atienza_reading/bookshelf/__pycache__/urls.cpython-39.pyc
+0
-0
views.cpython-39.pyc
...tienza_reading/bookshelf/__pycache__/views.cpython-39.pyc
+0
-0
authors_details.html
...eading/bookshelf/templates/bookshelf/authors_details.html
+7
-1
edit-author.html
...za_reading/bookshelf/templates/bookshelf/edit-author.html
+18
-0
edit-book.html
...enza_reading/bookshelf/templates/bookshelf/edit-book.html
+3
-2
urls.py
migs_atienza_reading/bookshelf/urls.py
+2
-1
views.py
migs_atienza_reading/bookshelf/views.py
+6
-0
db.sqlite3
migs_atienza_reading/db.sqlite3
+0
-0
No files found.
migs_atienza_reading/bookshelf/__pycache__/urls.cpython-39.pyc
View file @
4fa16fd3
No preview for this file type
migs_atienza_reading/bookshelf/__pycache__/views.cpython-39.pyc
View file @
4fa16fd3
No preview for this file type
migs_atienza_reading/bookshelf/templates/bookshelf/authors_details.html
View file @
4fa16fd3
...
...
@@ -16,9 +16,15 @@
</a><br/><br/>
</h3>
<a
href=
"{% url 'bookshelf:edit-author' pk=object.pk %}"
method=
"post"
>
{% csrf_token %}
<input
type=
"submit"
value=
"Edit Author"
>
</a>
<h2>
Books by {{ object.first_name }} {{ object.last_name}} I Love:
<br/>
Books by {{ object.first_name }} {{ object.last_name
}} I Love:
<br/>
</h2>
<ul>
{% for object in object.get_author_books %}
<li>
...
...
migs_atienza_reading/bookshelf/templates/bookshelf/edit-author.html
0 → 100644
View file @
4fa16fd3
{% extends 'base.html' %}
{% block title %}Edit Author{% endblock %}
{% block content %}
<center>
<form
action=
""
method=
"post"
>
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<input
type=
"submit"
value=
"Save Changes"
/>
</form>
</center>
{% endblock %}
{% block links %}
<center><br/><br/><br/><br/><br/>
<a
href=
"/bookshelf/home"
>
Home
</a>
<a
href=
"/bookshelf/books"
>
Books
</a>
<a
href=
"/bookshelf/authors"
>
Authors
</a></center>
{% endblock %}
\ No newline at end of file
migs_atienza_reading/bookshelf/templates/bookshelf/edit-book.html
View file @
4fa16fd3
...
...
@@ -6,9 +6,10 @@
<table>
{{ form.as_table }}
</table>
<input
type=
"submit"
value=
"
Edit Book
"
/>
<input
type=
"submit"
value=
"
Save Changes
"
/>
</form>
</center>
{% endblock %}
</center>
{% endblock %}
{% block links %}
<center><br/><br/><br/><br/><br/>
<a
href=
"/bookshelf/home"
>
Home
</a>
...
...
migs_atienza_reading/bookshelf/urls.py
View file @
4fa16fd3
from
django.urls
import
path
from
.views
import
index
,
home_view
,
BooksListView
,
BooksDetailView
,
BooksCreateView
,
BooksUpdateView
,
\
AuthorsListView
,
AuthorsDetailView
,
AuthorsCreateView
AuthorsListView
,
AuthorsDetailView
,
AuthorsCreateView
,
AuthorsUpdateView
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
...
...
@@ -13,6 +13,7 @@ urlpatterns = [
path
(
'authors'
,
AuthorsListView
.
as_view
(),
name
=
'authors_list'
),
path
(
'authors/<int:pk>/details'
,
AuthorsDetailView
.
as_view
(),
name
=
'authors_details'
),
path
(
'authors/add'
,
AuthorsCreateView
.
as_view
(),
name
=
'add_author'
),
path
(
'authors/<int:pk>/edit'
,
AuthorsUpdateView
.
as_view
(),
name
=
'edit-author'
),
]
app_name
=
"<bookshelf>"
...
...
migs_atienza_reading/bookshelf/views.py
View file @
4fa16fd3
...
...
@@ -51,4 +51,10 @@ class AuthorsCreateView(CreateView):
model
=
Author
fields
=
'__all__'
template_name
=
"bookshelf/add-author.html"
class
AuthorsUpdateView
(
UpdateView
):
model
=
Author
fields
=
'__all__'
template_name
=
"bookshelf/edit-author.html"
# Create your views here.
migs_atienza_reading/db.sqlite3
View file @
4fa16fd3
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