Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_Alipins
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
Angelico Ruiz T. Teaño
widget_Alipins
Commits
85df01f9
Commit
85df01f9
authored
Apr 02, 2022
by
Irish Danielle Morales
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display WidgetUsers in homepage view
parent
54bd3093
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
views.py
widget_alipins/homepage/views.py
+19
-2
No files found.
widget_alipins/homepage/views.py
View file @
85df01f9
from
django.http
import
HttpResponse
# Create your views here.
from
.models
import
WidgetUser
,
Department
def
index
(
request
):
return
HttpResponse
(
"Welcome to Widget!"
)
\ No newline at end of file
return
HttpResponse
(
display_users
(
WidgetUser
.
objects
.
all
()))
def
display_users
(
data_list
):
display_output
=
"WIDGET USERS: <br>"
for
objects
in
data_list
:
display_output
+=
'''
{last_name}, {first_name} {middle_name}: {id}, {email}, {dept}, {home}<br>
'''
.
format
(
last_name
=
objects
.
last_name
,
first_name
=
objects
.
first_name
,
middle_name
=
objects
.
middle_name
,
id
=
objects
.
id_num
,
email
=
objects
.
email
,
dept
=
objects
.
department
.
dept_name
,
home
=
objects
.
department
.
home_unit
)
return
display_output
\ 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