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
9a4e1f5c
Commit
9a4e1f5c
authored
Jul 09, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only compute block types with children once
parent
3c7aa18d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+4
-4
No files found.
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
9a4e1f5c
...
@@ -54,6 +54,9 @@ SORT_REVISION_FAVOR_DRAFT = ('_id.revision', pymongo.DESCENDING)
...
@@ -54,6 +54,9 @@ SORT_REVISION_FAVOR_DRAFT = ('_id.revision', pymongo.DESCENDING)
# sort order that returns PUBLISHED items first
# sort order that returns PUBLISHED items first
SORT_REVISION_FAVOR_PUBLISHED
=
(
'_id.revision'
,
pymongo
.
ASCENDING
)
SORT_REVISION_FAVOR_PUBLISHED
=
(
'_id.revision'
,
pymongo
.
ASCENDING
)
BLOCK_TYPES_WITH_CHILDREN
=
list
(
set
(
name
for
name
,
class_
in
XBlock
.
load_classes
()
if
getattr
(
class_
,
'has_children'
,
False
)
))
class
MongoRevisionKey
(
object
):
class
MongoRevisionKey
(
object
):
"""
"""
...
@@ -460,14 +463,11 @@ class MongoModuleStore(ModuleStoreWriteBase):
...
@@ -460,14 +463,11 @@ class MongoModuleStore(ModuleStoreWriteBase):
# note this is a bit ugly as when we add new categories of containers, we have to add it here
# note this is a bit ugly as when we add new categories of containers, we have to add it here
course_id
=
self
.
fill_in_run
(
course_id
)
course_id
=
self
.
fill_in_run
(
course_id
)
block_types_with_children
=
set
(
name
for
name
,
class_
in
XBlock
.
load_classes
()
if
getattr
(
class_
,
'has_children'
,
False
)
)
query
=
SON
([
query
=
SON
([
(
'_id.tag'
,
'i4x'
),
(
'_id.tag'
,
'i4x'
),
(
'_id.org'
,
course_id
.
org
),
(
'_id.org'
,
course_id
.
org
),
(
'_id.course'
,
course_id
.
course
),
(
'_id.course'
,
course_id
.
course
),
(
'_id.category'
,
{
'$in'
:
list
(
block_types_with_children
)
})
(
'_id.category'
,
{
'$in'
:
BLOCK_TYPES_WITH_CHILDREN
})
])
])
# we just want the Location, children, and inheritable metadata
# we just want the Location, children, and inheritable metadata
record_filter
=
{
'_id'
:
1
,
'definition.children'
:
1
}
record_filter
=
{
'_id'
:
1
,
'definition.children'
:
1
}
...
...
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