Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Neptune_Sy_music
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
Star Neptune R. Sy
Neptune_Sy_music
Commits
32b47a92
Commit
32b47a92
authored
Mar 29, 2023
by
Star Neptune R. Sy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
authors.html is done, author details otw
parent
cc0412ae
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
5 deletions
+62
-5
urls.cpython-39.pyc
neptunesy_reading/bookshelf/__pycache__/urls.cpython-39.pyc
+0
-0
views.cpython-39.pyc
neptunesy_reading/bookshelf/__pycache__/views.cpython-39.pyc
+0
-0
authors.html
neptunesy_reading/bookshelf/templates/bookshelf/authors.html
+18
-0
authors_details.html
...eading/bookshelf/templates/bookshelf/authors_details.html
+27
-0
books.html
neptunesy_reading/bookshelf/templates/bookshelf/books.html
+3
-3
urls.py
neptunesy_reading/bookshelf/urls.py
+4
-2
views.py
neptunesy_reading/bookshelf/views.py
+10
-0
No files found.
neptunesy_reading/bookshelf/__pycache__/urls.cpython-39.pyc
View file @
32b47a92
No preview for this file type
neptunesy_reading/bookshelf/__pycache__/views.cpython-39.pyc
View file @
32b47a92
No preview for this file type
neptunesy_reading/bookshelf/templates/bookshelf/authors.html
0 → 100644
View file @
32b47a92
{% extends 'base.html' %}
{% block title %} My favorite authors {% endblock %}
{% block additional %} Neptune's favorite authors {% endblock %}
{% block content %}
<ul>
{% for author in object_list %}
<li><a
href=
"{{author.get_absolute_url}}/details/"
>
{{ author.first_name }}{{ author.last_name }}
{% endfor %}
</ul>
<div>
<a
href=
"/home"
>
Home
</a>
<a
href=
"/books"
>
Books
</a>
</div>
{% endblock %}
neptunesy_reading/bookshelf/templates/bookshelf/authors_details.html
0 → 100644
View file @
32b47a92
{% extends 'base.html' %}
{% block title %} {{object.first_name}} {{object.last_name}} {% endblock %}
{% block additional %} {{object.first_name}} {{object.last_name}} {% endblock %}
{% block content%}
<ul>
<li>
{{object.age}}
<li>
{{object.nationality}}
<li>
{{object.bio}}
</ul>
<div>
<p>
Books by {{object.first_name}} {{object.last_name}} I love
</p>
<ul>
{% for book in object_set.all %}
<li>
<a
href=
"/book/{{book.get_absolute_url}}/details/"
>
{{book.title}}
{% endfor %}
</ul>
<div>
<a
href=
"/home"
>
Home
</a>
<a
href=
"/books"
>
Books
</a>
<a
href=
"/authors"
>
Authors
</a>
\
</div>
</div>
{% endblock %}
neptunesy_reading/bookshelf/templates/bookshelf/books.html
View file @
32b47a92
{% extends 'base.html' %}
{% block title%} My favorite books {% endblock %}
{% block additional %}
<h1>
Neptune's favorite books
</h1>
{% endblock %}
{% block additional %}
Neptune's favorite books
{% endblock %}
{% block content %}
<
o
l>
<
u
l>
{% for obj in object_list %}
<li><a
href=
"{{obj.get_absolute_url}}/details/"
>
{{ obj.title }}
</a></li>
{% endfor %}
</
o
l>
</
u
l>
<div>
<a
href=
"/home"
>
Home
</a>
...
...
neptunesy_reading/bookshelf/urls.py
View file @
32b47a92
# bookshelf/urls.py
from
django.urls
import
path
from
.views
import
(
homeView
,
BooksView
,
BooksDetail
)
from
.views
import
(
homeView
,
BooksView
,
BooksDetail
,
AuthorView
,
AuthorDetail
)
urlpatterns
=
[
path
(
'home/'
,
homeView
,
name
=
'home'
),
path
(
'books/'
,
BooksView
.
as_view
(),
name
=
"books"
),
path
(
'books/<int:pk>/details/'
,
BooksDetail
.
as_view
(),
name
=
"book_details"
)
path
(
'books/<int:pk>/details/'
,
BooksDetail
.
as_view
(),
name
=
"book_details"
),
path
(
'authors/'
,
AuthorView
.
as_view
(),
name
=
"authors"
),
path
(
'authors/<int:pk>/details/'
,
AuthorDetail
.
as_view
(),
name
=
"author_details"
),
]
# This might be needed, depending on your Django version
...
...
neptunesy_reading/bookshelf/views.py
View file @
32b47a92
...
...
@@ -15,3 +15,13 @@ class BooksView(ListView):
class
BooksDetail
(
DetailView
):
model
=
Book
template_name
=
"bookshelf/book_detais.html"
class
AuthorView
(
ListView
):
model
=
Author
template_name
=
"bookshelf/authors.html"
class
AuthorDetail
(
DetailView
):
model
=
Author
template_name
=
"bookshelf/authors_details.html"
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