Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
janang_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
Jan Ericsson Ong Ang
janang_reading
Commits
44ba6191
Commit
44ba6191
authored
Mar 28, 2023
by
Jan Ericsson Ong Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edited views.py
parent
847cc9bc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
views.py
janang_reading/bookshelf/views.py
+17
-10
No files found.
janang_reading/bookshelf/views.py
View file @
44ba6191
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.views.generic.detail
import
DetailView
from
django.views.generic.list
import
ListView
from
.models
import
Author
,
Books
from
.models
import
Author
,
Books
from
django.views
import
View
# Create your views here.
# Create your views here.
def
bookshelfIndex
(
request
):
title
=
'Landing Page Stuff<br><br>'
output_view
=
""
+
Author
+
" wrote "
+
Books
+
"!"
return
HttpResponse
(
title
+
output_view
)
def
HomeView
(
request
):
return
render
(
request
,
'bookshelf/home.html'
,
{
'nickname'
:
'Jan'
})
def
new_view
(
request
):
class
BooksView
(
ListView
):
spotlightBook
=
Books
.
objects
.
all
()
model
=
Books
template_name
=
'bookshelf/books.html'
class
BookDetailsView
(
DetailView
):
model
=
Books
template_name
=
'bookshelf/books_details.html'
class
HomepageView
(
View
):
class
AuthorView
(
ListView
):
return
render
(
request
,
'bookshelf/templates/home.html'
,
{
'nickname'
,
'Jan'
}
)
model
=
Author
\ No newline at end of file
template_name
=
'bookshelf/author.html'
class
AuthorDetailView
(
DetailView
):
model
=
Author
template_name
=
'bookshelf/author_details.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