Added and finalized html in views.py, added signature to readme file

parent d994baee
CSCI 40-F
Group Members:
CASTILLO, Gareth Xerxes
205828 CASTILLO, Gareth Xerxes
GARCIA, Ann Colleen
OLIVARES, Christian Louis
204374 RODRIGUEZ, Neal Luigi D.
......@@ -20,3 +20,4 @@ CALENDAR-Olivares
[References]
[Signatures]
(sgd) Gareth Xerxes Yap Castillo March 5, 2023
\ No newline at end of file
from django.shortcuts import render
from django.shortcuts import HttpResponse
from .models import Department, WidgetUser
def all_departments(request):
department_list = Department.objects.all()
def all_widget_users(request):
widget_users_list = WidgetUsers.objects.all()
from .models import Department, WidgetUser
def index(request):
return HttpResponse("Welcome to Widget!<br> <br>"
"WIDGET USERS:<br>")
return_string = '<ul>'
for user in WidgetUser.objects.all():
return_string += '<li>{}, {} {}: {}, {}</li>'.format(
user.last_name, user.first_name, user.middle_name, user.department, user.department.home_unit
)
return_string += '</ul>'
html_string = '<html><head>Welcome to Widget!<br> <br> WIDGET USERS:</head><body>{}</body><html>'.format(return_string)
return HttpResponse(html_string)
\ No newline at end of file
No preview for this file type
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