Commit a239f146 authored by KaoruSawade's avatar KaoruSawade

Made Dashboard views.py display the data from models Department and WidgetUser

parent bafb184a
<p>Welcome to Widget!</p>
<p>WIDGET USERS:<br>
{% for user in widgetusers %}
{{user.last_name}}, {{user.first_name}} {{user.middle_name}}: {{user.department.dept_name}}, {{user.department.home_unit}}<br>
{% endfor %}
from django.shortcuts import render
from django.http import HttpResponse
from .models import Department, WidgetUser
def pageview(request):
return HttpResponse()
departments = Department.objects.all()
widgetusers = WidgetUser.objects.all()
return render(request, 'dashboard/dashboard.html', {'departments': departments, 'widgetusers': widgetusers})
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