Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
60bbfc5a
Commit
60bbfc5a
authored
Mar 16, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add @contract to _load_item
parent
9e7404cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+12
-1
No files found.
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
60bbfc5a
...
...
@@ -400,6 +400,9 @@ class CachingDescriptorSystem(MakoDescriptorSystem, EditInfoRuntimeMixin):
return
[]
new_contract
(
'CachingDescriptorSystem'
,
CachingDescriptorSystem
)
# The only thing using this w/ wildcards is contentstore.mongo for asset retrieval
def
location_to_query
(
location
,
wildcard
=
True
,
tag
=
'i4x'
):
"""
...
...
@@ -852,13 +855,21 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo
return
data
@contract
(
course_key
=
CourseKey
,
item
=
dict
,
apply_cached_metadata
=
bool
,
using_descriptor_system
=
"None|CachingDescriptorSystem"
)
def
_load_item
(
self
,
course_key
,
item
,
data_cache
,
apply_cached_metadata
=
True
,
using_descriptor_system
=
None
):
"""
Load an XModuleDescriptor from item, using the children stored in data_cache
Arguments:
course_key (CourseKey): which course to load from
item (UsageKey): which xblock to load
item (dict): A dictionary with the following keys:
location: The serialized UsageKey for the item to load
data_dir (optional): The directory name to use as the root data directory for this XModule
data_cache (dict): A dictionary mapping from UsageKeys to xblock field data
(this is the xblock data loaded from the database)
apply_cached_metadata (bool): Whether to use the cached metadata for inheritance
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment