Commit 11a40307 by bmedx

LMS urls cleanup for Django 1.11

- Remove usage of django.urls.patterns
- Change urls tuples to lists
- Make all string view names callables
- This is the second of several urls updates for LMS; a work in progress
parent 0255592c
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
URLs for badges API URLs for badges API
""" """
from django.conf import settings from django.conf import settings
from django.conf.urls import patterns, url from django.conf.urls import url
from .views import UserBadgeAssertions from .views import UserBadgeAssertions
urlpatterns = patterns( urlpatterns = [
'badges.api',
url('^assertions/user/' + settings.USERNAME_PATTERN + '/$', UserBadgeAssertions.as_view(), name='user_assertions'), url('^assertions/user/' + settings.USERNAME_PATTERN + '/$', UserBadgeAssertions.as_view(), name='user_assertions'),
) ]
...@@ -2,14 +2,10 @@ ...@@ -2,14 +2,10 @@
Branding API endpoint urls. Branding API endpoint urls.
""" """
from django.conf.urls import patterns, url from django.conf.urls import url
urlpatterns = patterns( from branding.views import footer
"",
url( urlpatterns = [
r"^footer$", url(r"^footer$", footer, name="branding_footer"),
"branding.views.footer", ]
name="branding_footer",
),
)
""" """
URLs for the Bulk Enrollment API URLs for the Bulk Enrollment API
""" """
from django.conf.urls import patterns, url from django.conf.urls import url
from bulk_enroll.views import BulkEnrollView from bulk_enroll.views import BulkEnrollView
urlpatterns = patterns( urlpatterns = [
'bulk_enroll.views',
url(r'^bulk_enroll', BulkEnrollView.as_view(), name='bulk_enroll'), url(r'^bulk_enroll', BulkEnrollView.as_view(), name='bulk_enroll'),
) ]
""" CCX API URLs. """ """
from django.conf.urls import include, patterns, url CCX API URLs.
"""
from django.conf.urls import include, url
urlpatterns = patterns( urlpatterns = [
'',
url(r'^v0/', include('lms.djangoapps.ccx.api.v0.urls', namespace='v0')), url(r'^v0/', include('lms.djangoapps.ccx.api.v0.urls', namespace='v0')),
) ]
""" CCX API v0 URLs. """ """
CCX API v0 URLs.
"""
from django.conf import settings from django.conf import settings
from django.conf.urls import include, patterns, url from django.conf.urls import include, url
from lms.djangoapps.ccx.api.v0 import views from lms.djangoapps.ccx.api.v0 import views
CCX_COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN.replace('course_id', 'ccx_course_id') CCX_COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN.replace('course_id', 'ccx_course_id')
CCX_URLS = patterns( CCX_URLS = [
'',
url(r'^$', views.CCXListView.as_view(), name='list'), url(r'^$', views.CCXListView.as_view(), name='list'),
url(r'^{}/?$'.format(CCX_COURSE_ID_PATTERN), views.CCXDetailView.as_view(), name='detail'), url(r'^{}/?$'.format(CCX_COURSE_ID_PATTERN), views.CCXDetailView.as_view(), name='detail'),
) ]
urlpatterns = patterns( urlpatterns = [
'',
url(r'^ccx/', include(CCX_URLS, namespace='ccx')), url(r'^ccx/', include(CCX_URLS, namespace='ccx')),
) ]
""" """
URLs for the CCX Feature. URLs for the CCX Feature.
""" """
from django.conf.urls import patterns, url from django.conf.urls import url
urlpatterns = patterns( import ccx.views
'',
url(r'^ccx_coach$', urlpatterns = [
'ccx.views.dashboard', name='ccx_coach_dashboard'), url(r'^ccx_coach$', ccx.views.dashboard, name='ccx_coach_dashboard'),
url(r'^create_ccx$', url(r'^create_ccx$', ccx.views.create_ccx, name='create_ccx'),
'ccx.views.create_ccx', name='create_ccx'), url(r'^save_ccx$', ccx.views.save_ccx, name='save_ccx'),
url(r'^save_ccx$', url(r'^ccx_invite$', ccx.views.ccx_invite, name='ccx_invite'),
'ccx.views.save_ccx', name='save_ccx'), url(r'^ccx_schedule$', ccx.views.ccx_schedule, name='ccx_schedule'),
url(r'^ccx_invite$', url(r'^ccx_manage_student$', ccx.views.ccx_student_management, name='ccx_manage_student'),
'ccx.views.ccx_invite', name='ccx_invite'),
url(r'^ccx_schedule$',
'ccx.views.ccx_schedule', name='ccx_schedule'),
url(r'^ccx_manage_student$',
'ccx.views.ccx_student_management', name='ccx_manage_student'),
# Grade book # Grade book
url(r'^ccx_gradebook$', url(r'^ccx_gradebook$', ccx.views.ccx_gradebook, name='ccx_gradebook'),
'ccx.views.ccx_gradebook', name='ccx_gradebook'), url(r'^ccx_gradebook/(?P<offset>[0-9]+)$', ccx.views.ccx_gradebook, name='ccx_gradebook'),
url(r'^ccx_gradebook/(?P<offset>[0-9]+)$',
'ccx.views.ccx_gradebook', name='ccx_gradebook'),
url(r'^ccx_grades.csv$', url(r'^ccx_grades.csv$', ccx.views.ccx_grades_csv, name='ccx_grades_csv'),
'ccx.views.ccx_grades_csv', name='ccx_grades_csv'), url(r'^ccx_set_grading_policy$', ccx.views.set_grading_policy, name='ccx_set_grading_policy'),
url(r'^ccx_set_grading_policy$', ]
'ccx.views.set_grading_policy', name='ccx_set_grading_policy'),
)
""" Certificates API URLs. """ """
from django.conf.urls import include, patterns, url Certificates API URLs.
"""
from django.conf.urls import include, url
urlpatterns = patterns( urlpatterns = [
'',
url(r'^v0/', include('lms.djangoapps.certificates.apis.v0.urls', namespace='v0')), url(r'^v0/', include('lms.djangoapps.certificates.apis.v0.urls', namespace='v0')),
) ]
""" Certificates API v0 URLs. """ """
Certificates API v0 URLs.
"""
from django.conf import settings from django.conf import settings
from django.conf.urls import include, patterns, url from django.conf.urls import include, url
from lms.djangoapps.certificates.apis.v0 import views from lms.djangoapps.certificates.apis.v0 import views
CERTIFICATES_URLS = patterns( CERTIFICATES_URLS = [
'',
url( url(
r'^{username}/courses/{course_id}/$'.format( r'^{username}/courses/{course_id}/$'.format(
username=settings.USERNAME_PATTERN, username=settings.USERNAME_PATTERN,
...@@ -14,9 +14,8 @@ CERTIFICATES_URLS = patterns( ...@@ -14,9 +14,8 @@ CERTIFICATES_URLS = patterns(
), ),
views.CertificatesDetailView.as_view(), name='detail' views.CertificatesDetailView.as_view(), name='detail'
), ),
) ]
urlpatterns = patterns( urlpatterns = [
'',
url(r'^certificates/', include(CERTIFICATES_URLS, namespace='certificates')), url(r'^certificates/', include(CERTIFICATES_URLS, namespace='certificates')),
) ]
""" """
URLs for the certificates app. URLs for the certificates app.
""" """
from django.conf import settings from django.conf import settings
from django.conf.urls import patterns, url from django.conf.urls import url
from certificates import views from certificates import views
urlpatterns = patterns( urlpatterns = [
'',
# Certificates HTML view end point to render web certs by user and course # Certificates HTML view end point to render web certs by user and course
url( url(
r'^user/(?P<user_id>[^/]*)/course/{course_id}'.format(course_id=settings.COURSE_ID_PATTERN), r'^user/(?P<user_id>[^/]*)/course/{course_id}'.format(course_id=settings.COURSE_ID_PATTERN),
...@@ -30,4 +27,4 @@ urlpatterns = patterns( ...@@ -30,4 +27,4 @@ urlpatterns = patterns(
url(r'search', views.search_certificates, name="search"), url(r'search', views.search_certificates, name="search"),
url(r'regenerate', views.regenerate_certificate_for_user, name="regenerate_certificate_for_user"), url(r'regenerate', views.regenerate_certificate_for_user, name="regenerate_certificate_for_user"),
url(r'generate', views.generate_certificate_for_user, name="generate_certificate_for_user"), url(r'generate', views.generate_certificate_for_user, name="generate_certificate_for_user"),
) ]
""" """
Class Dashboard API endpoint urls. Class Dashboard API endpoint urls.
""" """
from django.conf import settings from django.conf import settings
from django.conf.urls import patterns, url from django.conf.urls import url
COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN import class_dashboard.views
import class_dashboard.dashboard_data
urlpatterns = patterns( COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN
'',
urlpatterns = [
# Json request data for metrics for entire course # Json request data for metrics for entire course
url(r'^{}/all_sequential_open_distrib$'.format(settings.COURSE_ID_PATTERN), url(r'^{}/all_sequential_open_distrib$'.format(settings.COURSE_ID_PATTERN),
'class_dashboard.views.all_sequential_open_distrib', name="all_sequential_open_distrib"), class_dashboard.views.all_sequential_open_distrib, name="all_sequential_open_distrib"),
url(r'^{}/all_problem_grade_distribution$'.format(settings.COURSE_ID_PATTERN), url(r'^{}/all_problem_grade_distribution$'.format(settings.COURSE_ID_PATTERN),
'class_dashboard.views.all_problem_grade_distribution', name="all_problem_grade_distribution"), class_dashboard.views.all_problem_grade_distribution, name="all_problem_grade_distribution"),
# Json request data for metrics for particular section # Json request data for metrics for particular section
url(r'^{}/problem_grade_distribution/(?P<section>\d+)$'.format(settings.COURSE_ID_PATTERN), url(r'^{}/problem_grade_distribution/(?P<section>\d+)$'.format(settings.COURSE_ID_PATTERN),
'class_dashboard.views.section_problem_grade_distrib', name="section_problem_grade_distrib"), class_dashboard.views.section_problem_grade_distrib, name="section_problem_grade_distrib"),
# For listing students that opened a sub-section # For listing students that opened a sub-section
url(r'^get_students_opened_subsection$', url(r'^get_students_opened_subsection$',
'class_dashboard.dashboard_data.get_students_opened_subsection', name="get_students_opened_subsection"), class_dashboard.dashboard_data.get_students_opened_subsection, name="get_students_opened_subsection"),
# For listing of students' grade per problem # For listing of students' grade per problem
url(r'^get_students_problem_grades$', url(r'^get_students_problem_grades$',
'class_dashboard.dashboard_data.get_students_problem_grades', name="get_students_problem_grades"), class_dashboard.dashboard_data.get_students_problem_grades, name="get_students_problem_grades"),
# For generating metrics data as a csv # For generating metrics data as a csv
url(r'^post_metrics_data_csv_url', url(r'^post_metrics_data_csv_url',
'class_dashboard.dashboard_data.post_metrics_data_csv', name="post_metrics_data_csv"), class_dashboard.dashboard_data.post_metrics_data_csv, name="post_metrics_data_csv"),
) ]
""" API URLs. """ """
from django.conf.urls import include, patterns, url API URLs.
"""
from django.conf.urls import include, url
urlpatterns = patterns( urlpatterns = [
'',
url(r'^v0/', include('commerce.api.v0.urls', namespace='v0')), url(r'^v0/', include('commerce.api.v0.urls', namespace='v0')),
url(r'^v1/', include('commerce.api.v1.urls', namespace='v1')), url(r'^v1/', include('commerce.api.v1.urls', namespace='v1')),
) ]
""" API v0 URLs. """ """
from django.conf.urls import include, patterns, url API v0 URLs.
"""
from django.conf.urls import include, url
from commerce.api.v0 import views from commerce.api.v0 import views
BASKET_URLS = patterns( BASKET_URLS = [
'',
url(r'^$', views.BasketsView.as_view(), name='create'), url(r'^$', views.BasketsView.as_view(), name='create'),
url(r'^(?P<basket_id>[\w]+)/order/$', views.BasketOrderView.as_view(), name='retrieve_order'), url(r'^(?P<basket_id>[\w]+)/order/$', views.BasketOrderView.as_view(), name='retrieve_order'),
) ]
urlpatterns = patterns( urlpatterns = [
'',
url(r'^baskets/', include(BASKET_URLS, namespace='baskets')), url(r'^baskets/', include(BASKET_URLS, namespace='baskets')),
) ]
""" API v1 URLs. """ """ API v1 URLs. """
from django.conf import settings from django.conf import settings
from django.conf.urls import include, patterns, url from django.conf.urls import include, url
from commerce.api.v1 import views from commerce.api.v1 import views
COURSE_URLS = patterns( COURSE_URLS = [
'',
url(r'^$', views.CourseListView.as_view(), name='list'), url(r'^$', views.CourseListView.as_view(), name='list'),
url(r'^{}/$'.format(settings.COURSE_ID_PATTERN), views.CourseRetrieveUpdateView.as_view(), name='retrieve_update'), url(r'^{}/$'.format(settings.COURSE_ID_PATTERN), views.CourseRetrieveUpdateView.as_view(), name='retrieve_update'),
) ]
ORDER_URLS = patterns( ORDER_URLS = [
'',
url(r'^(?P<number>[-\w]+)/$', views.OrderView.as_view(), name='detail'), url(r'^(?P<number>[-\w]+)/$', views.OrderView.as_view(), name='detail'),
) ]
urlpatterns = patterns( urlpatterns = [
'',
url(r'^courses/', include(COURSE_URLS, namespace='courses')), url(r'^courses/', include(COURSE_URLS, namespace='courses')),
url(r'^orders/', include(ORDER_URLS, namespace='orders')), url(r'^orders/', include(ORDER_URLS, namespace='orders')),
) ]
""" """
Defines the URL routes for this app. Defines the URL routes for this app.
""" """
from django.conf.urls import patterns, url from django.conf.urls import url
from commerce import views from commerce import views
urlpatterns = patterns( urlpatterns = [
'',
url(r'^checkout/cancel/$', views.checkout_cancel, name='checkout_cancel'), url(r'^checkout/cancel/$', views.checkout_cancel, name='checkout_cancel'),
url(r'^checkout/error/$', views.checkout_error, name='checkout_error'), url(r'^checkout/error/$', views.checkout_error, name='checkout_error'),
url(r'^checkout/receipt/$', views.checkout_receipt, name='checkout_receipt'), url(r'^checkout/receipt/$', views.checkout_receipt, name='checkout_receipt'),
url(r'^checkout/verification_status/$', views.user_verification_status, name='user_verification_status'), url(r'^checkout/verification_status/$', views.user_verification_status, name='user_verification_status'),
]
)
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
Course Block API URLs Course Block API URLs
""" """
from django.conf import settings from django.conf import settings
from django.conf.urls import patterns, url from django.conf.urls import url
from .views import BlocksInCourseView, BlocksView from .views import BlocksInCourseView, BlocksView
urlpatterns = patterns( urlpatterns = [
'',
# This endpoint requires the usage_key for the starting block. # This endpoint requires the usage_key for the starting block.
url( url(
r'^v1/blocks/{}'.format(settings.USAGE_KEY_PATTERN), r'^v1/blocks/{}'.format(settings.USAGE_KEY_PATTERN),
...@@ -21,4 +20,4 @@ urlpatterns = patterns( ...@@ -21,4 +20,4 @@ urlpatterns = patterns(
BlocksInCourseView.as_view(), BlocksInCourseView.as_view(),
name="blocks_in_course" name="blocks_in_course"
), ),
) ]
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
Course API URLs Course API URLs
""" """
from django.conf import settings from django.conf import settings
from django.conf.urls import include, patterns, url from django.conf.urls import include, url
from .views import CourseDetailView, CourseListView from .views import CourseDetailView, CourseListView
urlpatterns = patterns( urlpatterns = [
'',
url(r'^v1/courses/$', CourseListView.as_view(), name="course-list"), url(r'^v1/courses/$', CourseListView.as_view(), name="course-list"),
url(r'^v1/courses/{}'.format(settings.COURSE_KEY_PATTERN), CourseDetailView.as_view(), name="course-detail"), url(r'^v1/courses/{}'.format(settings.COURSE_KEY_PATTERN), CourseDetailView.as_view(), name="course-detail"),
url(r'', include('course_api.blocks.urls')) url(r'', include('course_api.blocks.urls'))
) ]
""" """
Course Goals URLs Course Goals URLs
""" """
from django.conf.urls import include, patterns, url from django.conf.urls import include, url
from rest_framework import routers from rest_framework import routers
from .views import CourseGoalViewSet from .views import CourseGoalViewSet
...@@ -9,7 +9,6 @@ from .views import CourseGoalViewSet ...@@ -9,7 +9,6 @@ from .views import CourseGoalViewSet
router = routers.DefaultRouter() router = routers.DefaultRouter()
router.register(r'course_goals', CourseGoalViewSet, base_name='course_goal') router.register(r'course_goals', CourseGoalViewSet, base_name='course_goal')
urlpatterns = patterns( urlpatterns = [
'',
url(r'^v0/', include(router.urls, namespace='v0')), url(r'^v0/', include(router.urls, namespace='v0')),
) ]
...@@ -3,9 +3,8 @@ Course Structure API URI specification. ...@@ -3,9 +3,8 @@ Course Structure API URI specification.
Patterns here should simply point to version-specific patterns. Patterns here should simply point to version-specific patterns.
""" """
from django.conf.urls import include, patterns, url from django.conf.urls import include, url
urlpatterns = patterns( urlpatterns = [
'',
url(r'^v0/', include('course_structure_api.v0.urls', namespace='v0')) url(r'^v0/', include('course_structure_api.v0.urls', namespace='v0'))
) ]
...@@ -2,14 +2,13 @@ ...@@ -2,14 +2,13 @@
Courses Structure API v0 URI specification Courses Structure API v0 URI specification
""" """
from django.conf import settings from django.conf import settings
from django.conf.urls import patterns, url from django.conf.urls import url
from course_structure_api.v0 import views from course_structure_api.v0 import views
COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN
urlpatterns = patterns( urlpatterns = [
'',
url(r'^courses/$', views.CourseList.as_view(), name='list'), url(r'^courses/$', views.CourseList.as_view(), name='list'),
url(r'^courses/{}/$'.format(COURSE_ID_PATTERN), views.CourseDetail.as_view(), name='detail'), url(r'^courses/{}/$'.format(COURSE_ID_PATTERN), views.CourseDetail.as_view(), name='detail'),
url(r'^course_structures/{}/$'.format(COURSE_ID_PATTERN), views.CourseStructure.as_view(), name='structure'), url(r'^course_structures/{}/$'.format(COURSE_ID_PATTERN), views.CourseStructure.as_view(), name='structure'),
...@@ -18,4 +17,4 @@ urlpatterns = patterns( ...@@ -18,4 +17,4 @@ urlpatterns = patterns(
views.CourseGradingPolicy.as_view(), views.CourseGradingPolicy.as_view(),
name='grading_policy' name='grading_policy'
), ),
) ]
...@@ -2,16 +2,15 @@ ...@@ -2,16 +2,15 @@
Urls for sysadmin dashboard feature Urls for sysadmin dashboard feature
""" """
from django.conf.urls import patterns, url from django.conf.urls import url
from dashboard import sysadmin from dashboard import sysadmin
urlpatterns = patterns( urlpatterns = [
'',
url(r'^$', sysadmin.Users.as_view(), name="sysadmin"), url(r'^$', sysadmin.Users.as_view(), name="sysadmin"),
url(r'^courses/?$', sysadmin.Courses.as_view(), name="sysadmin_courses"), url(r'^courses/?$', sysadmin.Courses.as_view(), name="sysadmin_courses"),
url(r'^staffing/?$', sysadmin.Staffing.as_view(), name="sysadmin_staffing"), url(r'^staffing/?$', sysadmin.Staffing.as_view(), name="sysadmin_staffing"),
url(r'^gitlogs/?$', sysadmin.GitLogs.as_view(), name="gitlogs"), url(r'^gitlogs/?$', sysadmin.GitLogs.as_view(), name="gitlogs"),
url(r'^gitlogs/(?P<course_id>.+)$', sysadmin.GitLogs.as_view(), url(r'^gitlogs/(?P<course_id>.+)$', sysadmin.GitLogs.as_view(),
name="gitlogs_detail"), name="gitlogs_detail"),
) ]
""" """
Forum urls for the django_comment_client. Forum urls for the django_comment_client.
""" """
from django.conf.urls import patterns, url from django.conf.urls import url
from .views import DiscussionBoardFragmentView from discussion import views
urlpatterns = patterns( urlpatterns = [
'discussion.views', url(r'users/(?P<user_id>\w+)/followed$', views.followed_threads, name='followed_threads'),
url(r'users/(?P<user_id>\w+)$', views.user_profile, name='user_profile'),
url(r'users/(?P<user_id>\w+)/followed$', 'followed_threads', name='followed_threads'), url(r'^(?P<discussion_id>[\w\-.]+)/threads/(?P<thread_id>\w+)$', views.single_thread,
url(r'users/(?P<user_id>\w+)$', 'user_profile', name='user_profile'), name='single_thread'),
url(r'^(?P<discussion_id>[\w\-.]+)/threads/(?P<thread_id>\w+)$', 'single_thread', name='single_thread'), url(r'^(?P<discussion_id>[\w\-.]+)/inline$', views.inline_discussion, name='inline_discussion'),
url(r'^(?P<discussion_id>[\w\-.]+)/inline$', 'inline_discussion', name='inline_discussion'),
url( url(
r'discussion_board_fragment_view$', r'discussion_board_fragment_view$',
DiscussionBoardFragmentView.as_view(), views.DiscussionBoardFragmentView.as_view(),
name='discussion_board_fragment_view' name='discussion_board_fragment_view'
), ),
url(r'', 'forum_form_discussion', name='forum_form_discussion'), url(r'', views.forum_form_discussion, name='forum_form_discussion'),
) ]
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Discussion API URLs Discussion API URLs
""" """
from django.conf import settings from django.conf import settings
from django.conf.urls import include, patterns, url from django.conf.urls import include, url
from rest_framework.routers import SimpleRouter from rest_framework.routers import SimpleRouter
from discussion_api.views import CommentViewSet, CourseTopicsView, CourseView, ThreadViewSet from discussion_api.views import CommentViewSet, CourseTopicsView, CourseView, ThreadViewSet
...@@ -11,8 +11,7 @@ ROUTER = SimpleRouter() ...@@ -11,8 +11,7 @@ ROUTER = SimpleRouter()
ROUTER.register("threads", ThreadViewSet, base_name="thread") ROUTER.register("threads", ThreadViewSet, base_name="thread")
ROUTER.register("comments", CommentViewSet, base_name="comment") ROUTER.register("comments", CommentViewSet, base_name="comment")
urlpatterns = patterns( urlpatterns = [
"discussion_api",
url( url(
r"^v1/courses/{}".format(settings.COURSE_ID_PATTERN), r"^v1/courses/{}".format(settings.COURSE_ID_PATTERN),
CourseView.as_view(), CourseView.as_view(),
...@@ -24,4 +23,4 @@ urlpatterns = patterns( ...@@ -24,4 +23,4 @@ urlpatterns = patterns(
name="course_topics" name="course_topics"
), ),
url("^v1/", include(ROUTER.urls)), url("^v1/", include(ROUTER.urls)),
) ]
""" """
Base urls for the django_comment_client. Base urls for the django_comment_client.
""" """
from django.conf.urls import patterns, url from django.conf.urls import url
urlpatterns = patterns( from django_comment_client.base import views
'django_comment_client.base.views',
url(r'upload$', 'upload', name='upload'), urlpatterns = [
url(r'threads/(?P<thread_id>[\w\-]+)/update$', 'update_thread', name='update_thread'), url(r'upload$', views.upload, name='upload'),
url(r'threads/(?P<thread_id>[\w\-]+)/reply$', 'create_comment', name='create_comment'), url(r'threads/(?P<thread_id>[\w\-]+)/update$', views.update_thread, name='update_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/delete', 'delete_thread', name='delete_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/reply$', views.create_comment, name='create_comment'),
url(r'threads/(?P<thread_id>[\w\-]+)/upvote$', 'vote_for_thread', {'value': 'up'}, name='upvote_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/delete', views.delete_thread, name='delete_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/downvote$', 'vote_for_thread', {'value': 'down'}, name='downvote_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/upvote$', views.vote_for_thread, {'value': 'up'}, name='upvote_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/flagAbuse$', 'flag_abuse_for_thread', name='flag_abuse_for_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/downvote$', views.vote_for_thread, {'value': 'down'}, name='downvote_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/unFlagAbuse$', 'un_flag_abuse_for_thread', name='un_flag_abuse_for_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/flagAbuse$', views.flag_abuse_for_thread, name='flag_abuse_for_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/unvote$', 'undo_vote_for_thread', name='undo_vote_for_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/unFlagAbuse$', views.un_flag_abuse_for_thread,
url(r'threads/(?P<thread_id>[\w\-]+)/pin$', 'pin_thread', name='pin_thread'), name='un_flag_abuse_for_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/unpin$', 'un_pin_thread', name='un_pin_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/unvote$', views.undo_vote_for_thread, name='undo_vote_for_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/follow$', 'follow_thread', name='follow_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/pin$', views.pin_thread, name='pin_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/unfollow$', 'unfollow_thread', name='unfollow_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/unpin$', views.un_pin_thread, name='un_pin_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/close$', 'openclose_thread', name='openclose_thread'), url(r'threads/(?P<thread_id>[\w\-]+)/follow$', views.follow_thread, name='follow_thread'),
url(r'comments/(?P<comment_id>[\w\-]+)/update$', 'update_comment', name='update_comment'), url(r'threads/(?P<thread_id>[\w\-]+)/unfollow$', views.unfollow_thread, name='unfollow_thread'),
url(r'comments/(?P<comment_id>[\w\-]+)/endorse$', 'endorse_comment', name='endorse_comment'), url(r'threads/(?P<thread_id>[\w\-]+)/close$', views.openclose_thread, name='openclose_thread'),
url(r'comments/(?P<comment_id>[\w\-]+)/reply$', 'create_sub_comment', name='create_sub_comment'), url(r'comments/(?P<comment_id>[\w\-]+)/update$', views.update_comment, name='update_comment'),
url(r'comments/(?P<comment_id>[\w\-]+)/delete$', 'delete_comment', name='delete_comment'), url(r'comments/(?P<comment_id>[\w\-]+)/endorse$', views.endorse_comment, name='endorse_comment'),
url(r'comments/(?P<comment_id>[\w\-]+)/upvote$', 'vote_for_comment', {'value': 'up'}, name='upvote_comment'), url(r'comments/(?P<comment_id>[\w\-]+)/reply$', views.create_sub_comment, name='create_sub_comment'),
url(r'comments/(?P<comment_id>[\w\-]+)/downvote$', 'vote_for_comment', {'value': 'down'}, name='downvote_comment'), url(r'comments/(?P<comment_id>[\w\-]+)/delete$', views.delete_comment, name='delete_comment'),
url(r'comments/(?P<comment_id>[\w\-]+)/unvote$', 'undo_vote_for_comment', name='undo_vote_for_comment'), url(r'comments/(?P<comment_id>[\w\-]+)/upvote$', views.vote_for_comment, {'value': 'up'}, name='upvote_comment'),
url(r'comments/(?P<comment_id>[\w\-]+)/flagAbuse$', 'flag_abuse_for_comment', name='flag_abuse_for_comment'), url(r'comments/(?P<comment_id>[\w\-]+)/downvote$', views.vote_for_comment, {'value': 'down'},
url(r'comments/(?P<comment_id>[\w\-]+)/unFlagAbuse$', 'un_flag_abuse_for_comment', name='un_flag_abuse_for_comment'), name='downvote_comment'),
url(r'^(?P<commentable_id>[\w\-.]+)/threads/create$', 'create_thread', name='create_thread'), url(r'comments/(?P<comment_id>[\w\-]+)/unvote$', views.undo_vote_for_comment, name='undo_vote_for_comment'),
url(r'^(?P<commentable_id>[\w\-.]+)/follow$', 'follow_commentable', name='follow_commentable'), url(r'comments/(?P<comment_id>[\w\-]+)/flagAbuse$', views.flag_abuse_for_comment, name='flag_abuse_for_comment'),
url(r'^(?P<commentable_id>[\w\-.]+)/unfollow$', 'unfollow_commentable', name='unfollow_commentable'), url(r'comments/(?P<comment_id>[\w\-]+)/unFlagAbuse$', views.un_flag_abuse_for_comment,
url(r'users$', 'users', name='users'), name='un_flag_abuse_for_comment'),
) url(r'^(?P<commentable_id>[\w\-.]+)/threads/create$', views.create_thread, name='create_thread'),
url(r'^(?P<commentable_id>[\w\-.]+)/follow$', views.follow_commentable, name='follow_commentable'),
url(r'^(?P<commentable_id>[\w\-.]+)/unfollow$', views.unfollow_commentable, name='unfollow_commentable'),
url(r'users$', views.users, name='users'),
]
""" """
Urls for the django_comment_client. Urls for the django_comment_client.
""" """
from django.conf.urls import include, patterns, url from django.conf.urls import include, url
urlpatterns = patterns(
'',
urlpatterns = [
url(r'', include('django_comment_client.base.urls')), url(r'', include('django_comment_client.base.urls')),
) ]
""" """
URLs for EdxNotes. URLs for EdxNotes.
""" """
from django.conf.urls import patterns, url from django.conf.urls import url
from edxnotes import views
# Additionally, we include login URLs for the browseable API. # Additionally, we include login URLs for the browseable API.
urlpatterns = patterns( urlpatterns = [
"edxnotes.views", url(r"^/$", views.edxnotes, name="edxnotes"),
url(r"^/$", "edxnotes", name="edxnotes"), url(r"^/notes/$", views.notes, name="notes"),
url(r"^/notes/$", "notes", name="notes"), url(r"^/token/$", views.get_token, name="get_token"),
url(r"^/token/$", "get_token", name="get_token"), url(r"^/visibility/$", views.edxnotes_visibility, name="edxnotes_visibility"),
url(r"^/visibility/$", "edxnotes_visibility", name="edxnotes_visibility"), ]
)
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