urls.py 1.54 KB
Newer Older
1
"""The routes defined by the education package"""
2 3 4
from django.conf.urls import include
from django.urls import path
from django.views.generic.base import RedirectView
Jan's avatar
Jan committed
5

6 7 8 9 10 11
from education.views import (
    StudentParticipantView, BookInfoView,
    CourseIndexView, CourseDetailView, ExamCreateView,
    SummaryCreateView,
    ExamDetailView, SummaryDetailView
)
Jan's avatar
Jan committed
12 13

app_name = "education"
14

Jan's avatar
Jan committed
15
urlpatterns = [
16 17 18 19 20 21 22 23
    path('education/', include([
        path('books/', BookInfoView.as_view(), name="books"),
        path('courses/', include([
            path('<int:pk>/', include([
                path('exam/upload/', ExamCreateView.as_view(),
                     name="submit-exam"),
                path('summary/upload/', SummaryCreateView.as_view(),
                     name="submit-summary"),
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
24
                path('', CourseDetailView.as_view(), name="course"),
25
            ])),
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
26
            path('exam/<int:pk>/', ExamDetailView.as_view(), name="exam"),
27 28 29 30 31 32
            path('summary/(<int:pk>/', SummaryDetailView.as_view(),
                 name="summary"),
            path('exam/upload/', ExamCreateView.as_view(),
                 name="submit-exam"),
            path('summary/upload/', SummaryCreateView.as_view(),
                 name="submit-summary"),
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
33
            path('', CourseIndexView.as_view(), name="courses"),
34
        ])),
35 36 37 38
        path('student-participation/',
             StudentParticipantView.as_view(), name="student-participation"),
        path('', RedirectView.as_view(
            pattern_name='education:courses', permanent=True), name="index"),
39
    ])),
Jan's avatar
Jan committed
40
]