Commit 7ad2ce8d authored by Joan Denise Nocos's avatar Joan Denise Nocos

feat: modified assignments view to display assignments and their associated courses

parent 7a35f9eb
from django.http import HttpResponse
from assignments.models import Assignment, Course
# Create your views here.
def index(request):
return HttpResponse("This is the Assignments page!")
\ No newline at end of file
assignments_view = "ASSIGNMENTS: "
schoolwork = Assignment.objects.all()
for assignment in schoolwork:
assignments_view += "Assignment Name: {}<br>Description: {}<br>Perfect Score: {}<br>Passing Score: {}<br>Course/Section: {} {} {}<br><br>"
format(assignment.name,
assignment.description,
assignment.max_points,
assignment.passing_score,
assignment.course.course_code,
assignment.course.course_title,
assignment.course.section)
return HttpResponse(assignments_view)
\ No newline at end of file
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