You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Simplify backcompat definitions for url_name, et al (openedx#37845)
XModuleMixin and CourseOverview both provided some backcompat names
for some XBlock key attributes. Due to refactors that have happened
in edx-platform and improvements to the XBlock API that have happened
over the years, we can now simplify these backcompat mappings. The
new mappings (old -> new) are:
* .course_id -> .context_key
* .location -> .usage_key
* .url_name -> .usage_key.block_id
* .category -> .usage_key.block_type
These are the ways we would like developers to access these
attributes going forward, so it's important that we set the
example in XModuleMixin and CourseOverview.
Note: It is technically correct to go through `.scope_ids` for
these fields, but it's harder to read. Under the hood, the XBlock
API indeed uses `.scope_ids`:
https://github.com/openedx/XBlock/blob/v5.3.0/xblock/core.py#L422-L446
Part of: openedx/xblocks-contrib#125
0 commit comments