Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group 6
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
Patricia Isabella Nava
widget_group 6
Commits
501fc377
Commit
501fc377
authored
Apr 07, 2022
by
Pierre Ashley Salcedo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'salcedo/homepage'
parents
f99ce702
739ba144
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
28 deletions
+14
-28
index.html
widget_group_6/homepage/templates/homepage/index.html
+0
-20
views.py
widget_group_6/homepage/views.py
+14
-8
No files found.
widget_group_6/homepage/templates/homepage/index.html
deleted
100644 → 0
View file @
f99ce702
<!DOCTYPE html>
<html>
<head></head>
<body>
<h1>
WIDGET USERS:
</h1>
{% for widget_user in widget_user_entries %}
<p>
{{widget_user.last_name}},
{{widget_user.first_name}}
{{widget_user.middle_name}}:
{{widget_user.id_num}},
{{widget_user.email}},
{{widget_user.department.dept_name}}
{{widget_user.department.home_unit}}
</p>
{% endfor %}
</body>
</html>
\ No newline at end of file
widget_group_6/homepage/views.py
View file @
501fc377
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.template
import
loader
from
.models
import
WidgetUser
from
.models
import
WidgetUser
# Create your views here.
# Create your views here.
def
index
(
request
):
def
index
(
request
):
widget_users
=
WidgetUser
.
objects
.
all
()
widget_users
=
WidgetUser
.
objects
.
all
()
template
=
loader
.
get_template
(
'homepage
\
index.html'
)
html
=
"<html><body><h1>WIDGET USERS:</h1>"
context
=
{
for
widget_user
in
widget_users
:
'widget_user_entries'
:
widget_users
html
+=
"<p> {}, {} {}: {}, {}, {}, {} </p>"
.
format
(
}
widget_user
.
last_name
,
widget_user
.
first_name
,
widget_user
.
middle_name
,
widget_user
.
id_num
,
widget_user
.
email
,
widget_user
.
department
.
dept_name
,
widget_user
.
department
.
home_unit
)
html
+=
"</body></html>"
return
HttpResponse
(
template
.
render
(
context
,
request
)
)
return
HttpResponse
(
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