Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_princessgabi
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
Ysabella Panghulan
midterm_princessgabi
Commits
4005cf20
Commit
4005cf20
authored
Mar 06, 2023
by
Julia Anishka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed views format
parent
97e344a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
admin.py
widget_princessgabi/dashboard/admin.py
+2
-2
views.py
widget_princessgabi/dashboard/views.py
+5
-3
No files found.
widget_princessgabi/dashboard/admin.py
View file @
4005cf20
...
...
@@ -4,11 +4,11 @@ from .models import Department, WidgetUser
class
DepartmentAdmin
(
admin
.
ModelAdmin
):
model
=
Department
list_display
=
(
"dept_name"
,
"home_unit"
)
list_display
=
(
'dept_name'
,
'home_unit'
)
class
WidgetUserAdmin
(
admin
.
ModelAdmin
):
model
=
WidgetUser
list_display
=
(
"first_name"
,
"middle_name"
,
"last_name"
,
"department"
)
list_display
=
(
'first_name'
,
'middle_name'
,
'last_name'
,
'department'
)
admin
.
site
.
register
(
Department
,
DepartmentAdmin
)
admin
.
site
.
register
(
WidgetUser
,
WidgetUserAdmin
)
\ No newline at end of file
widget_princessgabi/dashboard/views.py
View file @
4005cf20
...
...
@@ -6,9 +6,11 @@ from .models import Department, WidgetUser
def
index
(
request
):
users
=
WidgetUser
.
objects
.
all
()
WelcomeMessage
=
"Welcome to Widget!<br><br>WIDGET USERS:<br>"
welcomeMessage
=
'Welcome to Widget!<br><br>WIDGET USERS:<br>'
widgetusers
=
''
for
user
in
users
:
WelcomeMessage
=
WelcomeMessage
+
user
.
last_name
+
", "
+
user
.
first_name
+
" "
+
user
.
middle_name
+
": "
+
user
.
department
.
dept_name
+
", "
+
user
.
department
.
home_unit
+
"<br>"
widgetusers
+=
user
.
last_name
+
', '
+
user
.
first_name
+
' '
+
user
.
middle_name
+
': '
widgetusers
+=
user
.
department
.
dept_name
+
', '
+
user
.
department
.
home_unit
+
'<br>'
return
HttpResponse
(
WelcomeMessage
)
\ No newline at end of file
return
HttpResponse
(
welcomeMessage
+
widgetusers
)
\ 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