Commit 11f28fcb authored by Katrina Bernice Tan's avatar Katrina Bernice Tan

Fixed Assignment Templates

parent b42f2948
...@@ -3,8 +3,8 @@ from . import views ...@@ -3,8 +3,8 @@ from . import views
from .views import MainView, AssignmentListView, AssignmentDetailView from .views import MainView, AssignmentListView, AssignmentDetailView
urlpatterns = [ urlpatterns = [
path('', MainView.as_view(), name='index'), path('', MainView.as_view(), name='assignments'),
path('assignment', AssignmentListView.as_view(), name='assignment-list'), path('assignments', AssignmentListView.as_view(), name='assignment-list'),
path('assignment/<int:pk>/details', AssignmentDetailView.as_view(), name ='assignment-detail'), path('assignment/<int:pk>/details', AssignmentDetailView.as_view(), name ='assignment-detail'),
] ]
......
...@@ -10,9 +10,9 @@ class MainView(View): ...@@ -10,9 +10,9 @@ class MainView(View):
def get(self, request): def get(self, request):
course = Course.objects.all().order_by('course_code') course = Course.objects.all().order_by('course_code')
assignment = Assignment.objects.all().order_by('course') assignment = Assignment.objects.all().order_by('course')
return render(request, 'index.html',{ return render(request, 'assignments.html',{
'course': course, 'course': course,
'assignment': assignment, 'assignments': assignment,
}) })
class AssignmentListView(ListView): class AssignmentListView(ListView):
......
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