Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nicsdevega_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
Nics De Vega
nicsdevega_reading
Commits
a719b59d
Commit
a719b59d
authored
Apr 25, 2023
by
Nics De Vega
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit to new branch, updated README.txt and added initial html files with views and urls
parent
8922ea7e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
7 deletions
+36
-7
add_author.html
...ega_reading/bookshelf/templates/bookshelf/add_author.html
+0
-0
add_book.html
...evega_reading/bookshelf/templates/bookshelf/add_book.html
+0
-0
edit_author.html
...ga_reading/bookshelf/templates/bookshelf/edit_author.html
+0
-0
edit_book.html
...vega_reading/bookshelf/templates/bookshelf/edit_book.html
+0
-0
home.html
nicsdevega_reading/bookshelf/templates/bookshelf/home.html
+5
-2
urls.py
nicsdevega_reading/bookshelf/urls.py
+8
-3
views.py
nicsdevega_reading/bookshelf/views.py
+23
-2
No files found.
nicsdevega_reading/bookshelf/templates/bookshelf/add_author.html
0 → 100644
View file @
a719b59d
nicsdevega_reading/bookshelf/templates/bookshelf/add_book.html
0 → 100644
View file @
a719b59d
nicsdevega_reading/bookshelf/templates/bookshelf/edit_author.html
0 → 100644
View file @
a719b59d
nicsdevega_reading/bookshelf/templates/bookshelf/edit_book.html
0 → 100644
View file @
a719b59d
nicsdevega_reading/bookshelf/templates/bookshelf/home.html
View file @
a719b59d
...
...
@@ -7,8 +7,11 @@
<h4
class=
"text-center"
>
I usually like books with religious themes that make me go
<b>
Insane
</b>
. I also like Revue Starlight!
</p>
<h2
class=
"text-center"
>
<small>
<a
href=
"/bookshelf/books/"
>
Books
</a>
<a
href=
"/bookshelf/authors/"
>
Authors
</a>
<a
href=
"../books/"
>
Books
</a>
<a
href=
"../authors/"
>
Authors
</a>
<br>
<a
href=
"../books/add"
>
Add Book
</a>
<a
href=
"../authors/add"
>
Add Author
</a>
</small>
</h2>
...
...
nicsdevega_reading/bookshelf/urls.py
View file @
a719b59d
from
django.urls
import
path
from
.views
import
homepage
,
index_view
,
BooksView
,
AuthorsView
,
BooksDetailView
,
AuthorsDetailView
from
.views
import
homepage
,
index_view
,
BooksView
,
AuthorsView
,
BooksDetailView
,
AuthorsDetailView
,
BooksCreateView
,
BooksUpdateView
,
AuthorsCreateView
,
AuthorsUpdateView
urlpatterns
=
[
path
(
''
,
index_view
,
name
=
'index'
),
path
(
'home/'
,
homepage
,
name
=
'home'
),
path
(
'books/'
,
BooksView
.
as_view
(),
name
=
'books'
),
path
(
'authors/'
,
AuthorsView
.
as_view
(),
name
=
'authors'
),
path
(
'books/<int:pk>/details/'
,
BooksDetailView
.
as_view
(),
name
=
'book_details'
),
path
(
'authors/<int:pk>/details/'
,
AuthorsDetailView
.
as_view
(),
name
=
'author_details'
)
path
(
'books/add/'
,
BooksCreateView
.
as_view
(),
name
=
'add_book'
),
path
(
'books/<int:pk>/edit/'
,
BooksUpdateView
.
as_view
(),
name
=
'update_book'
),
path
(
'authors/'
,
AuthorsView
.
as_view
(),
name
=
'authors'
),
path
(
'authors/<int:pk>/details/'
,
AuthorsDetailView
.
as_view
(),
name
=
'author_details'
),
path
(
'authors/add/'
,
AuthorsCreateView
.
as_view
(),
name
=
'add_author'
),
path
(
'authors/<int:pk>/edit/'
,
BooksUpdateView
.
as_view
(),
name
=
'update_author'
),
]
app_name
=
'bookshelf'
\ No newline at end of file
nicsdevega_reading/bookshelf/views.py
View file @
a719b59d
...
...
@@ -3,12 +3,13 @@ from django.http import HttpResponse
from
.models
import
Author
,
Book
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
def
index_view
(
request
):
return
HttpResponse
(
"<h3>Hello Welcome to My Bookshelf! Please go to another page lmao.</h3>"
)
def
homepage
(
request
):
return
render
(
request
,
'bookshelf/home.html'
,
{
'name'
:
'
homepage
'
})
return
render
(
request
,
'bookshelf/home.html'
,
{
'name'
:
'
Nics
'
})
class
BooksView
(
ListView
):
model
=
Book
...
...
@@ -18,10 +19,30 @@ class BooksDetailView(DetailView):
model
=
Book
template_name
=
"bookshelf/book_details.html"
class
BooksCreateView
(
CreateView
):
model
=
Book
fields
=
'__all__'
template_name
=
"bookshelf/add_book.html"
class
BooksUpdateView
(
UpdateView
):
model
=
Book
fields
=
'__all__'
template_name
=
"bookshelf/edit_book.html"
class
AuthorsView
(
ListView
):
model
=
Author
template_name
=
"bookshelf/authors.html"
class
AuthorsDetailView
(
DetailView
):
model
=
Author
template_name
=
"bookshelf/author_details.html"
\ No newline at end of file
template_name
=
"bookshelf/author_details.html"
class
AuthorsCreateView
(
CreateView
):
model
=
Author
fields
=
'__all__'
template_name
=
"bookshelf/add_author.html"
class
AuthorsUpdateView
(
UpdateView
):
model
=
Book
fields
=
'__all__'
template_name
=
"bookshelf/edit_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