created the views of the Dashboard showing a welcome message along with the info of WidgetUsers

parent 6887b1ae
from django.shortcuts import render from django.http import HttpResponse
from .models import Department, WidgetUser
def dashboardIndex(request):
users = WidgetUser.objects.all()
departments = Department.objects.all()
dashboard_output = "Welcome to Widget!" + "<br>" + "<br>" + "WIDGRT USERS:" + "<br>" + "<br>"
for user in users:
username = user.last_name + ", " + user.first_name + " " + user.middle_name + ": "
home_department = user.department.dept_name + ", " + user.department.home_unit
dashboard_output = dashboard_output + username + home_department + "<br>"
return HttpResponse(dashboard_output)
# Create your views here.
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