Commit 7957ee9d authored by rachbit's avatar rachbit

edited the url views for app assignments

parent 88cd26db
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
from .models import Assignment, Course
def index(request): def index(request):
return HttpResponse('Hello World! This is assignments')
return_string = '<body>'
for assignment in Assignment.objects.all():
assignment_details = 'Assignment Name: {}<br>Description: {}<br>Perfect Score: {}<br> Passing Score: {}<br>Course/Section: {} {}-{}<br>'.format(
assignment.name,
assignment.description,
assignment.perfect_score,
assignment.passing_score(),
assignment.course.code,
assignment.course.title,
assignment.course.section
)
return_string += assignment_details + '<br>'
html_string = '<html>{}</html>'.format(return_string)
return HttpResponse('Widget\'s Assignments Page<br><br>' + html_string)
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