Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_bigdjangoenergy
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
Alec Dayupay
midterm_bigdjangoenergy
Commits
1a4b625a
Commit
1a4b625a
authored
May 08, 2023
by
Jose Enrique D. Siongco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed commented code in views.py of the dashboard app
parent
5940d495
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
views.py
widget_bigdjangoenergy/dashboard/views.py
+24
-13
No files found.
widget_bigdjangoenergy/dashboard/views.py
View file @
1a4b625a
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Department
,
WidgetUser
from
.models
import
Department
,
WidgetUser
def
dashboard
(
request
):
def
dashboard
(
request
):
widgetusers
=
WidgetUser
.
objects
.
all
()
return
render
(
request
,
'dashboard/dashboard.html'
,
{
'WidgetUser'
:
WidgetUser
.
objects
.
all
()})
response
=
"Welcome to Widget!<br><br>WIDGET USERS:<br>"
for
user
in
widgetusers
:
class
WidgetuserDetailView
(
DetailView
):
response
+=
"{}, {} {}: {}, {}<br>"
.
format
(
model
=
WidgetUser
user
.
last_name
,
template_name
=
'dashboard/widgetuser-details.html'
user
.
first_name
,
fields
=
'__all__'
user
.
middle_name
,
user
.
department
,
user
.
department
.
home_unit
class
WidgetuserCreateView
(
CreateView
):
)
model
=
WidgetUser
fields
=
'__all__'
return
HttpResponse
(
response
)
template_name
=
'dashboard/widgetuser-add.html'
\ No newline at end of file
class
WidgetuserUpdateView
(
UpdateView
):
model
=
WidgetUser
fields
=
'__all__'
template_name
=
'dashboard/widgetuser-edit.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