Finalized dashboard view format

parent 24cb1ea0
......@@ -5,12 +5,10 @@ from .models import Department, WidgetUser
def index (request):
return_string = '<p>Welcome to Widget!</p> WIDGET USERS:<ul>'
return_string = '<p>Welcome to Widget!</p> WIDGET USERS:<br>'
for user in WidgetUser.objects.all():
for department in Department.objects.all():
return_string += '{}, {} {}: {}, {}<br>'.format(
user.last_name, user.first_name, user.middle_name, department.dept_name, department.home_unit
)
return_string += '</ul>'
return_string += '{}, {} {}: {}, {}<br>'.format(
user.last_name, user.first_name, user.middle_name, user.department.dept_name, user.department.home_unit
)
html_string = '<html><body>{}</body></html>'.format(return_string)
return HttpResponse(html_string)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment