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
f6998759
Commit
f6998759
authored
Apr 06, 2022
by
Pierre Ashley Salcedo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update view of homepage app to display entries from WidgetUser model
parent
f1f4d8d5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
models.cpython-38.pyc
widget_group_6/homepage/__pycache__/models.cpython-38.pyc
+0
-0
views.cpython-38.pyc
widget_group_6/homepage/__pycache__/views.cpython-38.pyc
+0
-0
index.html
widget_group_6/homepage/templates/homepage/index.html
+20
-0
views.py
widget_group_6/homepage/views.py
+10
-1
No files found.
widget_group_6/homepage/__pycache__/models.cpython-38.pyc
View file @
f6998759
No preview for this file type
widget_group_6/homepage/__pycache__/views.cpython-38.pyc
View file @
f6998759
No preview for this file type
widget_group_6/homepage/templates/homepage/index.html
0 → 100644
View file @
f6998759
<!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 @
f6998759
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.template
import
loader
from
.models
import
WidgetUser
# Create your views here.
# Create your views here.
def
index
(
request
):
def
index
(
request
):
return
HttpResponse
(
"Welcome to Widget!"
)
widget_users
=
WidgetUser
.
objects
.
all
()
template
=
loader
.
get_template
(
'homepage
\
index.html'
)
context
=
{
'widget_user_entries'
:
widget_users
}
return
HttpResponse
(
template
.
render
(
context
,
request
))
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