Routers#

Opaque-key lookup_value_regex constants for DRF routers, so ViewSets keyed by course or usage keys share one spelling of the URL-delimiting patterns.

COURSE_KEY_LOOKUP_REGEX = '[^/+]+(?:/|\\+)[^/+]+(?:/|\\+)[^/?]+'#

Matches new-style (course-v1:org+course+run) and old-style (org/course/run) course keys.

USAGE_KEY_LOOKUP_REGEX = '(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+)'#

Matches new-style (block-v1:...+type@...+block@...) and old-style (i4x://org/course/category/name) usage keys.