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

parent d994baee
CSCI 40-F CSCI 40-F
Group Members: Group Members:
CASTILLO, Gareth Xerxes 205828 CASTILLO, Gareth Xerxes
GARCIA, Ann Colleen GARCIA, Ann Colleen
OLIVARES, Christian Louis OLIVARES, Christian Louis
204374 RODRIGUEZ, Neal Luigi D. 204374 RODRIGUEZ, Neal Luigi D.
...@@ -19,4 +19,5 @@ CALENDAR-Olivares ...@@ -19,4 +19,5 @@ CALENDAR-Olivares
[References] [References]
[Signatures] [Signatures]
\ No newline at end of file (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 django.shortcuts import HttpResponse
from .models import Department, WidgetUser
def all_departments(request):
department_list = Department.objects.all()
def all_widget_users(request): from .models import Department, WidgetUser
widget_users_list = WidgetUsers.objects.all()
def index(request): def index(request):
return HttpResponse("Welcome to Widget!<br> <br>" return_string = '<ul>'
"WIDGET USERS:<br>") 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