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
5afc3fc9
Commit
5afc3fc9
authored
May 01, 2023
by
Migs Atienza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added edit book html + edit book button in details
parent
07b31f40
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
3 deletions
+31
-3
.name
.idea/.name
+1
-1
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
books_details.html
..._reading/bookshelf/templates/bookshelf/books_details.html
+4
-0
edit-book.html
...enza_reading/bookshelf/templates/bookshelf/edit-book.html
+17
-0
urls.py
migs_atienza_reading/bookshelf/urls.py
+3
-2
views.py
migs_atienza_reading/bookshelf/views.py
+6
-0
db.sqlite3
migs_atienza_reading/db.sqlite3
+0
-0
No files found.
.idea/.name
View file @
5afc3fc9
settings.py
tests.py
\ No newline at end of file
\ No newline at end of file
migs_atienza_reading/bookshelf/__pycache__/urls.cpython-39.pyc
View file @
5afc3fc9
No preview for this file type
migs_atienza_reading/bookshelf/__pycache__/views.cpython-39.pyc
View file @
5afc3fc9
No preview for this file type
migs_atienza_reading/bookshelf/templates/bookshelf/books_details.html
View file @
5afc3fc9
...
@@ -18,6 +18,10 @@
...
@@ -18,6 +18,10 @@
{{ object.blurb }}
{{ object.blurb }}
</a>
</a>
</h3>
</h3>
<a
href=
"{% url 'bookshelf:edit-book' pk=object.pk %}"
method=
"post"
>
{% csrf_token %}
<input
type=
"submit"
value=
"Edit Book"
>
</a>
</center>
{% endblock %}
</center>
{% endblock %}
{% block links %}
{% block links %}
<center><br/><br/><br/><br/><br/>
<center><br/><br/><br/><br/><br/>
...
...
migs_atienza_reading/bookshelf/templates/bookshelf/edit-book.html
0 → 100644
View file @
5afc3fc9
{% extends 'base.html' %}
{% block title %}Edit Book{% endblock %}
{% block content %}
<center>
<form
action=
""
method=
"post"
>
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<input
type=
"submit"
value=
"Edit Book"
/>
</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/urls.py
View file @
5afc3fc9
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
index
,
home_view
,
BooksListView
,
BooksDetailView
,
BooksCreateView
,
AuthorsListView
,
\
from
.views
import
index
,
home_view
,
BooksListView
,
BooksDetailView
,
BooksCreateView
,
BooksUpdateView
,
\
AuthorsDetailView
,
AuthorsCreateView
Authors
ListView
,
Authors
DetailView
,
AuthorsCreateView
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
''
,
index
,
name
=
'index'
),
...
@@ -9,6 +9,7 @@ urlpatterns = [
...
@@ -9,6 +9,7 @@ urlpatterns = [
path
(
'books'
,
BooksListView
.
as_view
(),
name
=
'books_list'
),
path
(
'books'
,
BooksListView
.
as_view
(),
name
=
'books_list'
),
path
(
'books/<int:pk>/details'
,
BooksDetailView
.
as_view
(),
name
=
'books_details'
),
path
(
'books/<int:pk>/details'
,
BooksDetailView
.
as_view
(),
name
=
'books_details'
),
path
(
'books/add'
,
BooksCreateView
.
as_view
(),
name
=
'add_book'
),
path
(
'books/add'
,
BooksCreateView
.
as_view
(),
name
=
'add_book'
),
path
(
'books/<int:pk>/edit'
,
BooksUpdateView
.
as_view
(),
name
=
'edit-book'
),
path
(
'authors'
,
AuthorsListView
.
as_view
(),
name
=
'authors_list'
),
path
(
'authors'
,
AuthorsListView
.
as_view
(),
name
=
'authors_list'
),
path
(
'authors/<int:pk>/details'
,
AuthorsDetailView
.
as_view
(),
name
=
'authors_details'
),
path
(
'authors/<int:pk>/details'
,
AuthorsDetailView
.
as_view
(),
name
=
'authors_details'
),
path
(
'authors/add'
,
AuthorsCreateView
.
as_view
(),
name
=
'add_author'
),
path
(
'authors/add'
,
AuthorsCreateView
.
as_view
(),
name
=
'add_author'
),
...
...
migs_atienza_reading/bookshelf/views.py
View file @
5afc3fc9
...
@@ -31,6 +31,12 @@ class BooksCreateView(CreateView):
...
@@ -31,6 +31,12 @@ class BooksCreateView(CreateView):
template_name
=
"bookshelf/add-book.html"
template_name
=
"bookshelf/add-book.html"
class
BooksUpdateView
(
UpdateView
):
model
=
Book
fields
=
'__all__'
template_name
=
"bookshelf/edit-book.html"
class
AuthorsListView
(
ListView
):
class
AuthorsListView
(
ListView
):
model
=
Author
model
=
Author
template_name
=
"bookshelf/authors.html"
template_name
=
"bookshelf/authors.html"
...
...
migs_atienza_reading/db.sqlite3
View file @
5afc3fc9
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