Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
agusyquia_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
Agu Syquia
agusyquia_reading
Commits
cd9843e4
Commit
cd9843e4
authored
Mar 30, 2023
by
Agu Syquia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated views.py
Fixed the classes and functions and implemented ListView and DetailView
parent
846d6d6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
views.py
agusyquia_reading/bookshelf/views.py
+22
-5
No files found.
agusyquia_reading/bookshelf/views.py
View file @
cd9843e4
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
.models
import
Author
,
Books
from
django.views
import
View
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
.models
import
Books
,
Author
def
home_view
(
request
):
return
render
(
request
,
'bookshelf/home.html'
)
class
BooksView
(
ListView
):
model
=
Books
template_name
=
'bookshelf/books.html'
class
BooksDetailsView
(
DetailView
):
model
=
Books
class
AuthorsView
(
ListView
):
model
=
Author
template_name
=
'bookshelf/authors.html'
class
AuthorsDetailsView
(
DetailView
):
model
=
Author
def
bookshelfIndex
(
request
):
bookshelf_output
=
''
return
HttpResponse
(
bookshelf_output
)
# Create your views here.
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