Commit 9327ad66 authored by Sharmaine Chua's avatar Sharmaine Chua

edited the url views for app dashboard

parent bf4c3511
from django.shortcuts import render
from django.http import HttpResponse
from .models import WidgetUser
def index(request):
return HttpResponse("Welcome to Widget!")
return_string = '<body>'
for user in WidgetUser.objects.all():
user_string = '{}, {} {}'.format(
user.last_name, user.first_name, user.middle_name
)
dept_string = '{}: {}'.format(
user.department.dept_name, user.department.home_unit
)
return_string += user_string + " from the " + dept_string + "<br>"
html_string = '<html>{}</html>'.format(return_string)
return HttpResponse("Welcome to Widget! <br> <br>WIDGET USERS: <br>" + 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