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
d7f59963
Commit
d7f59963
authored
Apr 25, 2023
by
Christian Louis Olivares
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
completed add-book, deleted forms.py since it was not needed
parent
091d2e80
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
11 deletions
+39
-11
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
+0
-2
add-author.html
...res_reading/bookshelf/templates/bookshelf/add-author.html
+0
-0
add-book.html
...vares_reading/bookshelf/templates/bookshelf/add-book.html
+29
-0
home.html
...solivares_reading/bookshelf/templates/bookshelf/home.html
+1
-3
views.py
chrisolivares_reading/bookshelf/views.py
+9
-6
No files found.
chrisolivares_reading/bookshelf/__pycache__/urls.cpython-310.pyc
View file @
d7f59963
No preview for this file type
chrisolivares_reading/bookshelf/__pycache__/views.cpython-310.pyc
View file @
d7f59963
No preview for this file type
chrisolivares_reading/bookshelf/forms.py
deleted
100644 → 0
View file @
091d2e80
from
django
import
forms
chrisolivares_reading/bookshelf/templates/bookshelf/add-author.html
0 → 100644
View file @
d7f59963
chrisolivares_reading/bookshelf/templates/bookshelf/add-book.html
0 → 100644
View file @
d7f59963
{% extends 'base.html' %}
{% block title %}Add New Book{% endblock %}
{% block heading %}
{% endblock %}
{% block text %}
<form
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"Save"
>
</form>
{% endblock %}
{% block content %}
hi
{% endblock %}
{%block hyperlinks%}
<ul>
{% for object in object_list %}
<li><a
href=
"{{object.get_absolute_url}}"
>
{{object.title}}
</a></li>
{% endfor %}
<br></br>
<a
href=
"/home"
>
Home
</a>
<a
href=
"/authors"
>
Authors
</a>
</ul>
{%endblock%}
\ No newline at end of file
chrisolivares_reading/bookshelf/templates/bookshelf/home.html
View file @
d7f59963
...
...
@@ -18,9 +18,7 @@ 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%}
<br></br>
<a
href=
"/books/add"
>
Add Book
</a>
<a
href=
"/authors/add"
>
Add Author
</a>
{%endblock%}
\ No newline at end of file
chrisolivares_reading/bookshelf/views.py
View file @
d7f59963
from
django.shortcuts
import
render
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
#To be able to use CreateView & UpdateView
from
.models
import
Author
,
Book
# Create your views here.
...
...
@@ -34,10 +35,12 @@ class AuthorDetailsView(DetailView):
class
AddBookView
(
ListView
):
template_name
=
"bookshelf/add-book.html"
model
=
Author
class
AddBookView
(
CreateView
):
model
=
Book
fields
=
'__all__'
template_name
=
'bookshelf/add-book.html'
class
AddAuthorView
(
ListView
):
template_name
=
"bookshelf/add-author.html"
model
=
Author
\ No newline at end of file
class
AddAuthorView
(
CreateView
):
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/add-author.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