Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
migs_atienza_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
Migs Atienza
migs_atienza_reading
Commits
b80b35b6
Commit
b80b35b6
authored
Apr 30, 2023
by
Migs Atienza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added add book page
parent
4f90495d
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
36 additions
and
4 deletions
+36
-4
.name
.idea/.name
+1
-0
README.txt
README.txt
+3
-3
urls.cpython-39.pyc
...atienza_reading/bookshelf/__pycache__/urls.cpython-39.pyc
+0
-0
views.cpython-39.pyc
...tienza_reading/bookshelf/__pycache__/views.cpython-39.pyc
+0
-0
add-book.html
...ienza_reading/bookshelf/templates/bookshelf/add-book.html
+17
-0
home.html
migs_atienza_reading/bookshelf/templates/bookshelf/home.html
+2
-0
urls.py
migs_atienza_reading/bookshelf/urls.py
+3
-1
views.py
migs_atienza_reading/bookshelf/views.py
+10
-0
db.sqlite3
migs_atienza_reading/db.sqlite3
+0
-0
No files found.
.idea/.name
0 → 100644
View file @
b80b35b6
settings.py
\ No newline at end of file
README.txt
View file @
b80b35b6
...
...
@@ -2,7 +2,7 @@ Miguel Luis Antonio A. Atienza
210523
BS CS - DGDD
F
Lab 0
3: My Favorite Books and Authors
April
13
, 2023
Lab 0
4: My Favorite Books and Authors v2
April
30
, 2023
This lab requirement was made by me and only me.
<sgd> Miguel Luis Antonio A. Atienza, April
13
, 2023
<sgd> Miguel Luis Antonio A. Atienza, April
30
, 2023
migs_atienza_reading/bookshelf/__pycache__/urls.cpython-39.pyc
View file @
b80b35b6
No preview for this file type
migs_atienza_reading/bookshelf/__pycache__/views.cpython-39.pyc
View file @
b80b35b6
No preview for this file type
migs_atienza_reading/bookshelf/templates/bookshelf/add-book.html
0 → 100644
View file @
b80b35b6
{% extends 'base.html' %}
{% block title %}Add New Book{% endblock %}
{% block content %}
<center>
<form
action=
""
method=
"post"
>
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<input
type=
"submit"
value=
"Add Book"
/>
</form>
</center>
{% endblock %}
{% block links %}
<center><br/><br/><br/><br/><br/>
<a
href=
"/bookshelf/home"
>
Home
</a>
<a
href=
"/bookshelf/books"
>
Books
</a>
<a
href=
"/bookshelf/authors"
>
Authors
</a></center>
{% endblock %}
\ No newline at end of file
migs_atienza_reading/bookshelf/templates/bookshelf/home.html
View file @
b80b35b6
...
...
@@ -8,5 +8,7 @@ a while back. An author I enjoy here would be Rick Riordan and his Percy Jackson
{% block links %}
<center><br/><br/><br/><br/><br/>
<a
href=
"books"
>
Books
</a>
<a>
Add Book
</a>
<a
href=
"authors"
>
Authors
</a></center>
<a>
Add Author
</a>
{% endblock %}
migs_atienza_reading/bookshelf/urls.py
View file @
b80b35b6
from
django.urls
import
path
from
.views
import
index
,
home_view
,
BooksListView
,
BooksDetailView
,
AuthorsListView
,
AuthorsDetailView
from
.views
import
index
,
home_view
,
BooksListView
,
BooksDetailView
,
BooksCreateView
,
AuthorsListView
,
\
AuthorsDetailView
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
'home'
,
home_view
,
name
=
'home_view'
),
path
(
'books'
,
BooksListView
.
as_view
(),
name
=
'books_list'
),
path
(
'books/<int:pk>/details'
,
BooksDetailView
.
as_view
(),
name
=
'books_details'
),
path
(
'books/add'
,
BooksCreateView
.
as_view
(),
name
=
'add_book'
),
path
(
'authors'
,
AuthorsListView
.
as_view
(),
name
=
'authors_list'
),
path
(
'authors/<int:pk>/details'
,
AuthorsDetailView
.
as_view
(),
name
=
'authors_details'
),
]
...
...
migs_atienza_reading/bookshelf/views.py
View file @
b80b35b6
from
django.shortcuts
import
render
from
django.views.generic.detail
import
DetailView
from
django.views.generic.list
import
ListView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
django.http
import
HttpResponse
from
.models
import
Author
,
Book
...
...
@@ -24,6 +25,12 @@ class BooksDetailView(DetailView):
template_name
=
"bookshelf/books_details.html"
class
BooksCreateView
(
CreateView
):
model
=
Book
fields
=
'__all__'
template_name
=
"bookshelf/add-book.html"
class
AuthorsListView
(
ListView
):
model
=
Author
template_name
=
"bookshelf/authors.html"
...
...
@@ -32,4 +39,7 @@ class AuthorsListView(ListView):
class
AuthorsDetailView
(
DetailView
):
model
=
Author
template_name
=
"bookshelf/authors_details.html"
# Create your views here.
migs_atienza_reading/db.sqlite3
View file @
b80b35b6
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