New Feature: Added an html template in homepage\templates to be used in views.py.

Improvement: edited code of views.py of homepage app to display widget users and their respective information.
parent dc5b6def
<p>
<h2>WIDGET USERS:</h2>
{% for Department in Departments %}
<p>
<b>{{Department.widgetuser.last_name}}, {{Department.widgetuser.first_name}} {{Department.widgetuser.middle_name}}</b>:
{{Department.widgetuser.id_num}}, {{Department.widgetuser.email}}, {{Department.dept_name}}, {{Department.home_unit}}
</p>
{% endfor %}
</p>
\ No newline at end of file
from django.http import HttpResponse
from django.shortcuts import render
from .models import WidgetUser, Department
def index(request):
return HttpResponse("Welcome to Widget!")
Departments = Department.objects.all()
return render(request, 'widgetusers_listings.html', {'Departments': Departments})
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