Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nishaespera_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
Julia Anishka
nishaespera_reading
Commits
0a3547f4
Commit
0a3547f4
authored
Mar 27, 2023
by
Julia Anishka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added homepage view
parent
7a55e49d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
12 deletions
+26
-12
models.cpython-310.pyc
...pera_reading/bookshelf/__pycache__/models.cpython-310.pyc
+0
-0
models.py
nishaespera_reading/bookshelf/models.py
+1
-1
home.html
nishaespera_reading/bookshelf/templates/bookshelf/home.html
+10
-9
urls.py
nishaespera_reading/bookshelf/urls.py
+2
-1
views.py
nishaespera_reading/bookshelf/views.py
+13
-1
db.sqlite3
nishaespera_reading/db.sqlite3
+0
-0
No files found.
nishaespera_reading/bookshelf/__pycache__/models.cpython-310.pyc
View file @
0a3547f4
No preview for this file type
nishaespera_reading/bookshelf/models.py
View file @
0a3547f4
...
...
@@ -16,7 +16,7 @@ class Author(models.Model):
def
verify_ISBN
(
value
):
if
value
.
isdigit
()
==
False
:
raise
ValidationError
(
'ISBN must only be integers.'
)
if
value
!=
13
:
if
int
(
len
(
value
))
!=
13
:
raise
ValidationError
(
'ISBN must be a 13 digit number.'
)
def
verify_wordCount
(
value
):
...
...
nishaespera_reading/bookshelf/templates/bookshelf/home.html
View file @
0a3547f4
{% extends 'base.html' %}
{% block content %}
<h2><center>
Welcome to Nisha's Database of
<br>
Favorite Books and Authors!
</center></h2>
<p>
The genres I usually enjoy include mystery, romance, and fantasy. From narratives
that revolve around crimes to supernatural elements in a fictional world, I find each
scene interesting. I enjoyed books written by J.K Rowling, specifically, Harry Potter due
to her intricate plotlines. Another favorite author is Taylor Jenkins Reid because of her
emotional and engaging storytelling. The characters in her book are deeply relatable and
she's able to move her readers through genuine dialogues.
</p>
{% block body %}
<h1>
My Favorite Books
&
Authors
</h1>
<h3><center>
Welcome to Nisha's Database of
<br>
Favorite Books and Authors!
</center></h3>
<p>
The genres I usually enjoy include mystery, romance, and fantasy. From narratives
that revolve around crimes to supernatural elements in a fictional world, I find each
scene interesting. I enjoyed books written by J.K Rowling, specifically, Harry Potter due
to her intricate plotlines. Another favorite author is Taylor Jenkins Reid because of her
emotional and engaging storytelling. The characters in her book are deeply relatable and
she's able to move her readers through genuine dialogues.
</p>
<h5>
<a
href=
"{% url 'books' %}"
>
Books
</a>
<a
href=
"{% url 'authors'}"
>
Authors
</a></h5>
{% endblock %}
\ No newline at end of file
nishaespera_reading/bookshelf/urls.py
View file @
0a3547f4
...
...
@@ -3,7 +3,8 @@ from django.urls import path
from
.
import
views
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
'index'
)
path
(
'home'
,
views
.
homepage_view
,
name
=
'home'
)
path
(
'books'
,
BooksView
.
as_view
(),
name
=
'books'
)
]
...
...
nishaespera_reading/bookshelf/views.py
View file @
0a3547f4
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.views
import
View
from
.models
import
Author
,
Books
def
homepage_view
(
request
):
authors
=
Author
.
objects
.
all
()
books
=
Books
.
author
.
all
()
context
=
{
'authors'
:
authors
,
'books'
:
books
}
return
render
(
request
,
'home.html'
,
context
)
# Create your views here.
nishaespera_reading/db.sqlite3
View file @
0a3547f4
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