Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gab_salas_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
Jose Gabriel L. Salas
gab_salas_reading
Commits
1cf0bf9b
Commit
1cf0bf9b
authored
Apr 25, 2023
by
Jose Gabriel L. Salas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed bookshelf templates files
parent
4a34477b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
7 deletions
+17
-7
views.cpython-310.pyc
...salas_reading/bookshelf/__pycache__/views.cpython-310.pyc
+0
-0
author_details.html
...reading/bookshelf/templates/bookshelf/author_details.html
+5
-3
authors.html
gab_salas_reading/bookshelf/templates/bookshelf/authors.html
+0
-0
books.html
gab_salas_reading/bookshelf/templates/bookshelf/books.html
+0
-0
home.html
gab_salas_reading/bookshelf/templates/bookshelf/home.html
+0
-0
views.py
gab_salas_reading/bookshelf/views.py
+12
-4
No files found.
gab_salas_reading/bookshelf/__pycache__/views.cpython-310.pyc
View file @
1cf0bf9b
No preview for this file type
gab_salas_reading/bookshelf/templates/bookshelf/author_detail.html
→
gab_salas_reading/bookshelf/templates/bookshelf/author_detail
s
.html
View file @
1cf0bf9b
...
...
@@ -13,9 +13,11 @@
<br>
<h>
Books by {{ object }} I love:
</h>
<br>
<li>
<a
href=
"/bookshelf/books/{{ object.books.get_absolute_url }}"
>
{{ object.books.title }}
</a>
</li>
{% for book in books %}
{% if book.author == object %}
<a
href=
"{{ book.get_absolute_url }}"
>
{{ book.title }}
</a>
{% endif %}
{% endfor %}
<br>
<a
href=
"/bookshelf/home/"
>
Home
</a>
<a
href=
"/bookshelf/books/"
>
Books
</a>
...
...
gab_salas_reading/bookshelf/templates/bookshelf/author
_list
.html
→
gab_salas_reading/bookshelf/templates/bookshelf/author
s
.html
View file @
1cf0bf9b
File moved
gab_salas_reading/bookshelf/templates/bookshelf/books
_list
.html
→
gab_salas_reading/bookshelf/templates/bookshelf/books.html
View file @
1cf0bf9b
File moved
gab_salas_reading/bookshelf/templates/home.html
→
gab_salas_reading/bookshelf/templates/
bookshelf/
home.html
View file @
1cf0bf9b
File moved
gab_salas_reading/bookshelf/views.py
View file @
1cf0bf9b
...
...
@@ -6,17 +6,25 @@ from django.views.generic.detail import DetailView
from
django.views.generic.list
import
ListView
def
index
(
request
):
return
render
(
request
,
'home.html'
,
{
'name'
:
'Gab'
})
return
render
(
request
,
'
bookshelf/
home.html'
,
{
'name'
:
'Gab'
})
class
BooksListView
(
ListView
):
model
=
Books
template_name
=
"bookshelf/books.html"
class
BooksDetailView
(
DetailView
):
model
=
Books
template_name
=
"bookshelf/book_details.html"
class
AuthorListView
(
ListView
):
model
=
Author
template_name
=
"bookshelf/authors.html"
class
AuthorDetailView
(
DetailView
):
model
=
Author
\ No newline at end of file
model
=
Author
template_name
=
"bookshelf/author_details.html"
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
()
.
get_context_data
(
**
kwargs
)
context
[
'books'
]
=
Books
.
objects
.
all
()
return
context
\ 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