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
133bd767
Commit
133bd767
authored
Mar 20, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small refactoring to use a better semantic with regards to the parameter
parent
f462cd6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
common/lib/xmodule/xmodule/modulestore/mongo.py
+7
-5
No files found.
common/lib/xmodule/xmodule/modulestore/mongo.py
View file @
133bd767
...
...
@@ -376,7 +376,7 @@ class MongoModuleStore(ModuleStoreBase):
return
data
def
_load_item
(
self
,
item
,
data_cache
,
depth
=
0
):
def
_load_item
(
self
,
item
,
data_cache
,
should_apply_metadata_inheritence
=
True
):
"""
Load an XModuleDescriptor from item, using the children stored in data_cache
"""
...
...
@@ -389,9 +389,8 @@ class MongoModuleStore(ModuleStoreBase):
resource_fs
=
OSFS
(
root
)
metadata_inheritance_tree
=
None
# if we are loading a course object, if we're not prefetching children (depth != 0) then don't
# bother with the metadata inheritence
if
item
[
'location'
][
'category'
]
!=
'course'
or
depth
!=
0
:
if
should_apply_metadata_inheritence
:
metadata_inheritance_tree
=
self
.
get_cached_metadata_inheritance_tree
(
Location
(
item
[
'location'
]))
# TODO (cdodge): When the 'split module store' work has been completed, we should remove
...
...
@@ -414,7 +413,10 @@ class MongoModuleStore(ModuleStoreBase):
"""
data_cache
=
self
.
_cache_children
(
items
,
depth
)
return
[
self
.
_load_item
(
item
,
data_cache
,
depth
)
for
item
in
items
]
# if we are loading a course object, if we're not prefetching children (depth != 0) then don't
# bother with the metadata inheritence
return
[
self
.
_load_item
(
item
,
data_cache
,
should_apply_metadata_inheritence
=
(
item
[
'location'
][
'category'
]
!=
'course'
or
depth
!=
0
))
for
item
in
items
]
def
get_courses
(
self
):
'''
...
...
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