Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_vincentdjango
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
1
Merge Requests
1
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
Almira Redoble
midterm_vincentdjango
Commits
34dd94ea
Commit
34dd94ea
authored
2 years ago
by
Almira Redoble
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated and implemented view following the specifications
parent
a2128669
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
3 deletions
+25
-3
admin.cpython-311.pyc
...vincentdjango/dashboard/__pycache__/admin.cpython-311.pyc
+0
-0
views.cpython-311.pyc
...vincentdjango/dashboard/__pycache__/views.cpython-311.pyc
+0
-0
admin.py
widget_vincentdjango/dashboard/admin.py
+2
-2
views.py
widget_vincentdjango/dashboard/views.py
+23
-1
No files found.
widget_vincentdjango/dashboard/__pycache__/admin.cpython-311.pyc
View file @
34dd94ea
No preview for this file type
This diff is collapsed.
Click to expand it.
widget_vincentdjango/dashboard/__pycache__/views.cpython-311.pyc
View file @
34dd94ea
No preview for this file type
This diff is collapsed.
Click to expand it.
widget_vincentdjango/dashboard/admin.py
View file @
34dd94ea
...
...
@@ -15,7 +15,7 @@ class WidgetUserAdmin(admin.ModelAdmin):
fieldsets
=
[
(
'Name'
,
{
'fields'
:
'fields'
:
((
'last_name'
,
'first_name'
),
'middle_name'
,
'department'
,),
}),
]
...
...
@@ -30,7 +30,7 @@ class DepartmentAdmin(admin.ModelAdmin):
fieldsets
=
[
(
'Details'
,
{
'fields'
:
'fields'
:
((
'dept_name'
,
'home_unit'
),),
}),
]
...
...
This diff is collapsed.
Click to expand it.
widget_vincentdjango/dashboard/views.py
View file @
34dd94ea
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
.models
import
WidgetUser
def
index
(
request
):
return
HttpResponse
(
'Placeholder'
)
head
=
"<h1 style='border-bottom:4px solid lightgray;
\
padding-bottom:30px;
\
font-size:500
%
;'>
\
Welcome to Widget!
\
</h1>"
body
=
"<h2>WIDGET USERS:</h2>"
for
user
in
WidgetUser
.
objects
.
all
():
body
+=
"<p style='border: 2px solid gray;
\
border-radius:5px;
\
padding:20px 30px;'>
\
{}: {}<br>
\
</p>"
.
format
(
user
,
user
.
department
)
return_string
=
"<html>
\
<body style = 'font-family:helvetica;
\
padding:30px;'>
\
{}{}
\
</body></html>"
.
format
(
head
,
body
)
return
HttpResponse
(
return_string
)
This diff is collapsed.
Click to expand it.
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