- 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
24 lines
578 B
Python
24 lines
578 B
Python
"""
|
|
Course Block API URLs
|
|
"""
|
|
from django.conf import settings
|
|
from django.conf.urls import url
|
|
|
|
from .views import BlocksInCourseView, BlocksView
|
|
|
|
urlpatterns = [
|
|
# This endpoint requires the usage_key for the starting block.
|
|
url(
|
|
r'^v1/blocks/{}'.format(settings.USAGE_KEY_PATTERN),
|
|
BlocksView.as_view(),
|
|
name="blocks_in_block_tree"
|
|
),
|
|
|
|
# This endpoint is an alternative to the above, but requires course_id as a parameter.
|
|
url(
|
|
r'^v1/blocks/',
|
|
BlocksInCourseView.as_view(),
|
|
name="blocks_in_course"
|
|
),
|
|
]
|