Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gabigarrero_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
Gabriel G. Garrero
gabigarrero_reading
Commits
3792f387
Commit
3792f387
authored
Mar 28, 2023
by
Gabriel G. Garrero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assigned proper html files to views.py, edited the books html page, edited urls.py
parent
144d5013
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
8 deletions
+29
-8
urls.cpython-310.pyc
...arrero_reading/bookshelf/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
...rrero_reading/bookshelf/__pycache__/views.cpython-310.pyc
+0
-0
books.html
gabigarrero_reading/bookshelf/templates/bookshelf/books.html
+15
-1
urls.py
gabigarrero_reading/bookshelf/urls.py
+9
-6
views.py
gabigarrero_reading/bookshelf/views.py
+5
-1
No files found.
gabigarrero_reading/bookshelf/__pycache__/urls.cpython-310.pyc
View file @
3792f387
No preview for this file type
gabigarrero_reading/bookshelf/__pycache__/views.cpython-310.pyc
View file @
3792f387
No preview for this file type
gabigarrero_reading/bookshelf/templates/bookshelf/books.html
View file @
3792f387
...
@@ -2,8 +2,22 @@
...
@@ -2,8 +2,22 @@
{% load static %}
{% load static %}
{% block title %}{% endblock %}
{% block title %}
My Favorite Books
{% endblock %}
{% block content %}
{% block content %}
<h1>
Gabi's Favorite Books:
</h1>
<ul>
{% for objects in object_list %}
<li>
<a
href =
"{{ object.get_absolute_url }}"
>
{{ object.title }}
</a>
</li>
{% endfor %}
</ul>
<a
href=
'/bookshelf/home/'
>
Home
</a>
<a
href=
'/bookshelf/authors/'
>
Authors
</a>
{% endblock %}
{% endblock %}
\ No newline at end of file
gabigarrero_reading/bookshelf/urls.py
View file @
3792f387
from
django.urls
import
path
from
django.urls
import
path
from
.
import
views
from
.views
import
(
home
,
BooksListView
,
BooksDetailView
,
AuthorListView
,
AuthorDetailView
)
urlpatterns
=
[
urlpatterns
=
[
path
(
'home/'
,
views
.
home
,
name
=
'home'
),
path
(
'home/'
,
home
,
name
=
'home'
),
path
(
'books/'
,
views
.
BooksListView
.
as_view
(),
name
=
'books-list'
),
path
(
'books/'
,
BooksListView
.
as_view
(),
name
=
'books-list'
),
path
(
'books/<int:pk>/details'
,
views
.
BooksDetailView
.
as_view
(),
name
=
'books-details'
),
path
(
'books/<int:pk>/details'
,
BooksDetailView
.
as_view
(),
name
=
'books-details'
),
path
(
'authors/'
,
views
.
AuthorListView
.
as_view
(),
name
=
'author-list'
),
path
(
'authors/'
,
AuthorListView
.
as_view
(),
name
=
'author-list'
),
path
(
'authors/<int:pk>/details'
,
views
.
AuthorDetailView
.
as_view
(),
name
=
'author-details'
),
path
(
'authors/<int:pk>/details'
,
AuthorDetailView
.
as_view
(),
name
=
'author-details'
),
]
]
app_name
=
"bookshelf"
app_name
=
"bookshelf"
\ No newline at end of file
gabigarrero_reading/bookshelf/views.py
View file @
3792f387
...
@@ -9,12 +9,16 @@ def home(request):
...
@@ -9,12 +9,16 @@ def home(request):
class
BooksListView
(
ListView
):
class
BooksListView
(
ListView
):
model
=
Books
model
=
Books
template_name
=
'bookshelf/books.html'
class
BooksDetailView
(
DetailView
):
class
BooksDetailView
(
DetailView
):
model
=
Books
model
=
Books
template_name
=
'bookshelf/books_details.html'
class
AuthorListView
(
ListView
):
class
AuthorListView
(
ListView
):
model
=
Author
model
=
Author
template_name
=
'bookshelf/authors.html'
class
AuthorDetailView
(
DetailView
):
class
AuthorDetailView
(
DetailView
):
model
=
Author
model
=
Author
\ No newline at end of file
template_name
=
'bookshelf/author_details.html'
\ No newline at end of file
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