Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_tee jays angelos
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
Ramon Angelo Enriquez
widget_tee jays angelos
Commits
2110edd2
Commit
2110edd2
authored
Mar 30, 2022
by
Ramon Angelo Enriquez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Homepage Views are now functional in showing the database information in the required format
parent
389bc251
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
models.py
widget_tee_jays_angelos/homepage/models.py
+1
-1
views.py
widget_tee_jays_angelos/homepage/views.py
+15
-2
No files found.
widget_tee_jays_angelos/homepage/models.py
View file @
2110edd2
...
...
@@ -10,7 +10,7 @@ class WidgetUser(models.Model):
email
=
models
.
CharField
(
max_length
=
50
,
null
=
True
)
def
__str__
(
self
):
return
self
.
first_name
+
" "
+
self
.
la
st_name
return
self
.
last_name
+
", "
+
self
.
fir
st_name
class
Department
(
models
.
Model
):
...
...
widget_tee_jays_angelos/homepage/views.py
View file @
2110edd2
...
...
@@ -5,5 +5,18 @@ from homepage.models import WidgetUser, Department
def
index
(
request
):
return
HttpResponse
(
"WIDGET USERS:<br>"
)
entries
=
WidgetUser
.
objects
.
all
()
.
count
()
n
=
1
users
=
"WIDGET USERS:<br/>"
while
(
n
<=
entries
):
userLastName
=
WidgetUser
.
objects
.
get
(
pk
=
n
)
.
last_name
userFirstName
=
WidgetUser
.
objects
.
get
(
pk
=
n
)
.
first_name
userMiddleName
=
WidgetUser
.
objects
.
get
(
pk
=
n
)
.
middle_name
userIdNum
=
WidgetUser
.
objects
.
get
(
pk
=
n
)
.
id_num
userEmail
=
WidgetUser
.
objects
.
get
(
pk
=
n
)
.
email
userDept
=
Department
.
objects
.
get
(
widget_user
=
n
)
.
dept_name
userHome
=
Department
.
objects
.
get
(
widget_user
=
n
)
.
home_unit
users
=
users
+
userLastName
+
", "
+
userFirstName
+
" "
+
userMiddleName
+
": "
+
userIdNum
+
", "
+
userEmail
+
", "
+
userDept
+
", "
+
userHome
+
"<br/>"
n
+=
1
return
HttpResponse
(
users
)
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