Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
danimuncal_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
Izaac Daniel B. Muncal
danimuncal_reading
Commits
8b8fc774
Commit
8b8fc774
authored
Apr 26, 2023
by
Izaac Daniel B. Muncal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated vies.py to add create and update view
parent
bdb86e50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
5 deletions
+37
-5
views.py
danimuncal_reading/bookshelf/views.py
+37
-5
No files found.
danimuncal_reading/bookshelf/views.py
View file @
8b8fc774
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.views.generic.detail
import
DetailView
from
django.views.generic.list
import
ListView
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Books
,
Author
from
.models
import
Books
,
Author
...
@@ -9,17 +10,48 @@ def home_view(request):
...
@@ -9,17 +10,48 @@ def home_view(request):
return
render
(
request
,
'bookshelf/home.html'
,
{
'nickname'
:
'Dani'
})
return
render
(
request
,
'bookshelf/home.html'
,
{
'nickname'
:
'Dani'
})
class
BooksView
(
ListView
):
class
AuthorsListView
(
ListView
):
model
=
Author
template_name
=
'bookshelf/authors.html'
class
AuthorsDetailView
(
DetailView
):
model
=
Author
template_name
=
'bookshelf/author_details.html'
class
BooksListView
(
ListView
):
model
=
Books
model
=
Books
template_name
=
'bookshelf/books.html'
class
BooksDetailView
(
DetailView
):
class
BooksDetailView
(
DetailView
):
model
=
Books
model
=
Books
template_name
=
'bookshelf/books_details.html'
class
Author
View
(
List
View
):
class
Author
CreateView
(
Create
View
):
model
=
Author
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/add-author.html'
class
AuthorDetailView
(
DetailView
):
class
BookCreateView
(
CreateView
):
model
=
Books
fields
=
'__all__'
template_name
=
'bookshelf/add-book.html'
class
AuthorUpdateView
(
UpdateView
):
model
=
Author
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/edit-author.html'
class
BookUpdateView
(
UpdateView
):
model
=
Books
fields
=
'__all__'
template_name
=
'bookshelf/edit-book.html'
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