Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_huli
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
midterm_huli
Commits
0c741fb2
Commit
0c741fb2
authored
May 12, 2023
by
Izaac Daniel B. Muncal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated views.py to accomodate widget user edit add and details
parent
126cd0f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
9 deletions
+22
-9
views.py
widget_huli/dashboard/views.py
+22
-9
No files found.
widget_huli/dashboard/views.py
View file @
0c741fb2
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
WidgetUser
,
Department
from
.models
import
WidgetUser
,
Department
def
index
(
request
):
def
dashboard_view
(
request
):
text_in_http
=
"Welcome to Widget! <br> <br> WIDGET USERS: <br> <ul>"
return
render
(
request
,
'dashboard/dashboard.html'
,{
'nickname'
:
'Dani'
})
for
user
in
WidgetUser
.
objects
.
all
():
text_in_http
+=
"<li>{}, {} {} : {}</li>"
.
format
(
user
.
last_name
,
user
.
first_name
,
user
.
middle_name
,
user
.
department
class
WidgetUserView
(
DetailView
):
)
model
=
WidgetUser
text_in_http
+=
"</ul>"
template_name
=
'dashboard/widgetuser-details.html'
html_string
=
'<html><body>{}</body></html>'
.
format
(
text_in_http
)
class
WidgetUserCreateView
(
CreateView
):
model
=
WidgetUser
fields
=
'__all__'
template_name
=
'dashboard/widgetuser-add.html'
class
WidgetUserUpdateView
(
UpdateView
):
model
=
WidgetUser
fields
=
'__all__'
template_name
=
'dashboard/widgetuser-edit.html'
return
HttpResponse
(
html_string
)
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