We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e49d898 commit 1e6fbefCopy full SHA for 1e6fbef
1 file changed
openedx/core/djangoapps/content_libraries/api/blocks.py
@@ -411,6 +411,15 @@ def set_library_block_olx(
411
very little validation is done and this can easily result in a broken XBlock
412
that won't load.
413
414
+ The optional ``paths_to_media`` parameter can be used to attach
415
+ openedx_content Media to this XBlock. A common use case for this would be to
416
+ add images or other static assets to a text block::
417
+
418
+ figure_a_media = content_api.get_or_create_file_media(...)
419
+ paths_to_media={
420
+ 'static/figure_a.png': figure_a_media,
421
+ }
422
423
Returns the version number of the newly created ComponentVersion.
424
"""
425
assert isinstance(usage_key, LibraryUsageLocatorV2)
0 commit comments