Esempio n. 1
0
        ),
        CourseDiscussionSettingsAPIView.as_view(),
        name="discussion_course_settings",
    ),
    re_path(
        fr"^v1/courses/{settings.COURSE_ID_PATTERN}/upload$",
        UploadFileView.as_view(),
        name="upload_file",
    ),
    re_path(
        r"^v1/courses/{}/roles/(?P<rolename>[A-Za-z0-9+ _-]+)/?$".format(
            settings.COURSE_ID_PATTERN
        ),
        CourseDiscussionRolesAPIView.as_view(),
        name="discussion_course_roles",
    ),
    re_path(
        fr"^v1/courses/{settings.COURSE_ID_PATTERN}",
        CourseView.as_view(),
        name="discussion_course"
    ),
    path('v1/accounts/retire_forum', RetireUserView.as_view(), name="retire_discussion_user"),
    path('v1/accounts/replace_username', ReplaceUsernamesView.as_view(), name="replace_discussion_username"),
    re_path(
        fr"^v1/course_topics/{settings.COURSE_ID_PATTERN}",
        CourseTopicsView.as_view(),
        name="course_topics"
    ),
    path('v1/', include(ROUTER.urls)),
]
Esempio n. 2
0
ROUTER = SimpleRouter()
ROUTER.register("threads", ThreadViewSet, basename="thread")
ROUTER.register("comments", CommentViewSet, basename="comment")

urlpatterns = [
    url(
        r"^v1/courses/{}/settings$".format(settings.COURSE_ID_PATTERN),
        CourseDiscussionSettingsAPIView.as_view(),
        name="discussion_course_settings",
    ),
    url(
        r"^v1/courses/{}/roles/(?P<rolename>[A-Za-z0-9+ _-]+)/?$".format(
            settings.COURSE_ID_PATTERN),
        CourseDiscussionRolesAPIView.as_view(),
        name="discussion_course_roles",
    ),
    url(fr"^v1/courses/{settings.COURSE_ID_PATTERN}",
        CourseView.as_view(),
        name="discussion_course"),
    url(r"^v1/accounts/retire_forum",
        RetireUserView.as_view(),
        name="retire_discussion_user"),
    url(r"^v1/accounts/replace_username",
        ReplaceUsernamesView.as_view(),
        name="replace_discussion_username"),
    url(fr"^v1/course_topics/{settings.COURSE_ID_PATTERN}",
        CourseTopicsView.as_view(),
        name="course_topics"),
    url("^v1/", include(ROUTER.urls)),
]
Esempio n. 3
0
urlpatterns = [
    url(
        r"^v1/courses/{}/settings$".format(
            settings.COURSE_ID_PATTERN
        ),
        CourseDiscussionSettingsAPIView.as_view(),
        name="discussion_course_settings",
    ),
    url(
        r"^v1/courses/{}/roles/(?P<rolename>[A-Za-z0-9+ _-]+)/?$".format(
            settings.COURSE_ID_PATTERN
        ),
        CourseDiscussionRolesAPIView.as_view(),
        name="discussion_course_roles",
    ),
    url(
        r"^v1/courses/{}".format(settings.COURSE_ID_PATTERN),
        CourseView.as_view(),
        name="discussion_course"
    ),
    url(r"^v1/accounts/retire_forum", RetireUserView.as_view(), name="retire_discussion_user"),
    url(r"^v1/accounts/replace_username", ReplaceUsernamesView.as_view(), name="replace_discussion_username"),
    url(
        r"^v1/course_topics/{}".format(settings.COURSE_ID_PATTERN),
        CourseTopicsView.as_view(),
        name="course_topics"
    ),
    url("^v1/", include(ROUTER.urls)),
]