Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
chrisolivares_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
Christian Louis Olivares
chrisolivares_reading
Commits
091d2e80
Commit
091d2e80
authored
Apr 25, 2023
by
Christian Louis Olivares
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added forms.py and hyperlinks
parent
0297cda7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
2 deletions
+23
-2
urls.cpython-310.pyc
...ivares_reading/bookshelf/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
...vares_reading/bookshelf/__pycache__/views.cpython-310.pyc
+0
-0
forms.py
chrisolivares_reading/bookshelf/forms.py
+2
-0
home.html
...solivares_reading/bookshelf/templates/bookshelf/home.html
+5
-0
urls.py
chrisolivares_reading/bookshelf/urls.py
+5
-1
views.py
chrisolivares_reading/bookshelf/views.py
+11
-1
No files found.
chrisolivares_reading/bookshelf/__pycache__/urls.cpython-310.pyc
View file @
091d2e80
No preview for this file type
chrisolivares_reading/bookshelf/__pycache__/views.cpython-310.pyc
View file @
091d2e80
No preview for this file type
chrisolivares_reading/bookshelf/forms.py
0 → 100644
View file @
091d2e80
from
django
import
forms
chrisolivares_reading/bookshelf/templates/bookshelf/home.html
View file @
091d2e80
...
...
@@ -18,4 +18,9 @@ I enjoy a plethora of genres. as long as the author imerses me in their world, t
{%block hyperlinks%}
<a
href=
"/books"
>
Books
</a>
<a
href=
"/authors"
>
Authors
</a>
{%endblock%}
{%block hyperlinks%}
<a
href=
"/books/add"
>
Add Book
</a>
<a
href=
"/authors/add"
>
Add Author
</a>
{%endblock%}
\ No newline at end of file
chrisolivares_reading/bookshelf/urls.py
View file @
091d2e80
from
django.urls
import
path
from
.views
import
home_view
,
BookListView
,
AuthorsListView
,
BookDetailsView
,
AuthorDetailsView
from
.views
import
home_view
,
BookListView
,
AuthorsListView
,
BookDetailsView
,
AuthorDetailsView
,
AddBookView
,
AddAuthorView
urlpatterns
=
[
path
(
''
,
home_view
,
name
=
"My Favorite Books & Authors"
),
...
...
@@ -10,6 +10,10 @@ urlpatterns = [
path
(
'authors/'
,
AuthorsListView
.
as_view
(),
name
=
"author-list"
),
path
(
'authors/<int:pk>/details/'
,
AuthorDetailsView
.
as_view
(),
name
=
"author-detail"
),
path
(
'books/add/'
,
AddBookView
.
as_view
(),
name
=
"add-book"
),
path
(
'authors/add/'
,
AddAuthorView
.
as_view
(),
name
=
"add-author"
),
]
app_name
=
'bookshelf'
\ No newline at end of file
chrisolivares_reading/bookshelf/views.py
View file @
091d2e80
...
...
@@ -30,4 +30,14 @@ class AuthorDetailsView(DetailView):
context
=
super
()
.
get_context_data
(
**
kwargs
)
# Add in a QuerySet of all the books
context
[
'book_list'
]
=
Book
.
objects
.
all
()
return
context
\ No newline at end of file
return
context
class
AddBookView
(
ListView
):
template_name
=
"bookshelf/add-book.html"
model
=
Author
class
AddAuthorView
(
ListView
):
template_name
=
"bookshelf/add-author.html"
model
=
Author
\ 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