Skip to content

Commit 1e6fbef

Browse files
committed
temp: add docstring comments
1 parent e49d898 commit 1e6fbef

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • openedx/core/djangoapps/content_libraries/api

openedx/core/djangoapps/content_libraries/api/blocks.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,15 @@ def set_library_block_olx(
411411
very little validation is done and this can easily result in a broken XBlock
412412
that won't load.
413413
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+
414423
Returns the version number of the newly created ComponentVersion.
415424
"""
416425
assert isinstance(usage_key, LibraryUsageLocatorV2)

0 commit comments

Comments
 (0)