Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
carynlopezgo_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
Caryn Lopez-Go
carynlopezgo_reading
Commits
fd327cc3
Commit
fd327cc3
authored
Apr 25, 2023
by
Caryn Lopez-Go
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated bookshelf with new update and add buttons
parent
02bd157e
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
72 additions
and
5 deletions
+72
-5
README.txt
README.txt
+3
-3
urls.cpython-310.pyc
bookshelf/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
bookshelf/__pycache__/views.cpython-310.pyc
+0
-0
add-author.html
bookshelf/templates/bookshelf/add-author.html
+9
-0
add-book.html
bookshelf/templates/bookshelf/add-book.html
+9
-0
author_details.html
bookshelf/templates/bookshelf/author_details.html
+1
-0
book_details.html
bookshelf/templates/bookshelf/book_details.html
+1
-0
edit-author.html
bookshelf/templates/bookshelf/edit-author.html
+9
-0
edit-book.html
bookshelf/templates/bookshelf/edit-book.html
+9
-0
home.html
bookshelf/templates/bookshelf/home.html
+2
-0
urls.py
bookshelf/urls.py
+5
-1
views.py
bookshelf/views.py
+24
-1
db.sqlite3
db.sqlite3
+0
-0
No files found.
README.txt
View file @
fd327cc3
Lopez-Go, Caryn Bryne C. (213558)
CSCI 40 C
Lab
3: My Favorite Books and Authors
March 28
, 2023
Lab
04: My Favorite Books and Authors v2
April 25
, 2023
This lab was made by me and only me.
<sgd> Caryn Bryne C. Lopez-Go, March 27, 2023
\ No newline at end of file
<sgd> Caryn Bryne C. Lopez-Go, April 25, 2023
\ No newline at end of file
bookshelf/__pycache__/urls.cpython-310.pyc
View file @
fd327cc3
No preview for this file type
bookshelf/__pycache__/views.cpython-310.pyc
View file @
fd327cc3
No preview for this file type
bookshelf/templates/bookshelf/add-author.html
0 → 100644
View file @
fd327cc3
{% extends 'base.html' %}
{% block title %}Add New Author{% endblock %}
{% block content %}
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"SUBMIT"
value=
"Add Author"
>
</form>
{% endblock %}
\ No newline at end of file
bookshelf/templates/bookshelf/add-book.html
0 → 100644
View file @
fd327cc3
{% extends 'base.html' %}
{% block title %}Add New Book{% endblock %}
{% block content %}
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"SUBMIT"
value=
"Add Book"
>
</form>
{% endblock %}
\ No newline at end of file
bookshelf/templates/bookshelf/author_details.html
View file @
fd327cc3
...
...
@@ -16,6 +16,7 @@
{% endfor %}
</ul>
<section
class=
"bottom"
>
<a
href=
"{% url 'bookshelf:edit-author' author.id %}"
>
Edit Author
</a><br>
<a
href=
"{% url 'bookshelf:home' %}"
>
Home
</a>
<a
href=
"{% url 'bookshelf:books' %}"
>
Books
</a>
<a
href=
"{% url 'bookshelf:authors' %}"
>
Authors
</a>
...
...
bookshelf/templates/bookshelf/book_details.html
View file @
fd327cc3
...
...
@@ -10,6 +10,7 @@
{{ books.blurb }}
<br>
</p>
<section
class=
"bottom"
>
<a
href=
"{% url 'bookshelf:edit-book' books.id %}"
>
Edit Book
</a><br>
<a
href=
"{% url 'bookshelf:home' %}"
>
Home
</a>
<a
href=
"{% url 'bookshelf:books' %}"
>
Books
</a>
<a
href=
"{% url 'bookshelf:authors' %}"
>
Authors
</a>
...
...
bookshelf/templates/bookshelf/edit-author.html
0 → 100644
View file @
fd327cc3
{% extends 'base.html' %}
{% block title %}Edit Author{% endblock %}
{% block content %}
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"SUBMIT"
value=
"Save Changes"
>
</form>
{% endblock %}
\ No newline at end of file
bookshelf/templates/bookshelf/edit-book.html
0 → 100644
View file @
fd327cc3
{% extends 'base.html' %}
{% block title %}Edit Book{% endblock %}
{% block content %}
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"SUBMIT"
value=
"Save Changes"
>
</form>
{% endblock %}
\ No newline at end of file
bookshelf/templates/bookshelf/home.html
View file @
fd327cc3
...
...
@@ -6,6 +6,8 @@
<section
class=
"bottom"
>
<a
href=
"{% url 'bookshelf:books' %}"
>
Books
</a>
<a
href=
"{% url 'bookshelf:authors' %}"
>
Authors
</a>
<a
href=
"{% url 'bookshelf:add-book' %}"
>
Add Book
</a>
<a
href=
"{% url 'bookshelf:add-author' %}"
>
Add Author
</a>
</section>
{% endblock %}
\ No newline at end of file
bookshelf/urls.py
View file @
fd327cc3
...
...
@@ -7,7 +7,11 @@ urlpatterns = [
path
(
'authors/'
,
AuthorsListView
.
as_view
(),
name
=
"authors"
),
path
(
'authors/<int:pk>/details'
,
AuthorDetailsView
.
as_view
(),
name
=
"author-details"
),
path
(
'books/'
,
BooksListView
.
as_view
(),
name
=
"books"
),
path
(
'books/<int:pk>/details'
,
BookDetailsView
.
as_view
(),
name
=
"book-details"
)
path
(
'books/<int:pk>/details'
,
BookDetailsView
.
as_view
(),
name
=
"book-details"
),
path
(
'books/add/'
,
BookCreateView
.
as_view
(),
name
=
"add-book"
),
path
(
'authors/add/'
,
AuthorCreateView
.
as_view
(),
name
=
"add-author"
),
path
(
'books/<int:pk>/edit/'
,
BookUpdateView
.
as_view
(),
name
=
"edit-book"
),
path
(
'authors/<int:pk>/edit/'
,
AuthorUpdateView
.
as_view
(),
name
=
"edit-author"
),
]
app_name
=
'bookshelf'
\ No newline at end of file
bookshelf/views.py
View file @
fd327cc3
...
...
@@ -4,11 +4,13 @@ from django.http import HttpResponse
from
.models
import
Author
,
Books
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
# Create your views here.
def
home
(
request
):
return
render
(
request
,
'bookshelf/home.html'
)
#Books
class
BooksListView
(
ListView
):
model
=
Books
template_name
=
'bookshelf/books.html'
...
...
@@ -17,10 +19,31 @@ class BookDetailsView(DetailView):
model
=
Books
template_name
=
'bookshelf/book_details.html'
class
BookCreateView
(
CreateView
):
model
=
Books
fields
=
'__all__'
template_name
=
'bookshelf/add-book.html'
class
BookUpdateView
(
UpdateView
):
model
=
Books
fields
=
'__all__'
template_name
=
'bookshelf/edit-book.html'
#Authors
class
AuthorsListView
(
ListView
):
model
=
Author
template_name
=
'bookshelf/authors.html'
class
AuthorDetailsView
(
DetailView
):
model
=
Author
template_name
=
'bookshelf/author_details.html'
\ No newline at end of file
template_name
=
'bookshelf/author_details.html'
class
AuthorCreateView
(
CreateView
):
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/add-author.html'
class
AuthorUpdateView
(
UpdateView
):
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/edit-author.html'
\ No newline at end of file
db.sqlite3
View file @
fd327cc3
No preview for this file type
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