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
1abae6f0
Commit
1abae6f0
authored
Jul 31, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Location to Locator mapping utilities
partial impl
parent
0833f87f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+3
-6
No files found.
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
1abae6f0
...
@@ -10,9 +10,8 @@ from xmodule.errortracker import null_error_tracker
...
@@ -10,9 +10,8 @@ from xmodule.errortracker import null_error_tracker
from
xmodule.x_module
import
XModuleDescriptor
from
xmodule.x_module
import
XModuleDescriptor
from
xmodule.modulestore.locator
import
BlockUsageLocator
,
DescriptionLocator
,
CourseLocator
,
VersionTree
from
xmodule.modulestore.locator
import
BlockUsageLocator
,
DescriptionLocator
,
CourseLocator
,
VersionTree
from
xmodule.modulestore.exceptions
import
InsufficientSpecificationError
,
VersionConflictError
from
xmodule.modulestore.exceptions
import
InsufficientSpecificationError
,
VersionConflictError
from
xmodule.modulestore
import
inheritance
from
xmodule.modulestore
import
inheritance
,
ModuleStoreBase
from
..
import
ModuleStoreBase
from
..exceptions
import
ItemNotFoundError
from
..exceptions
import
ItemNotFoundError
from
.definition_lazy_loader
import
DefinitionLazyLoader
from
.definition_lazy_loader
import
DefinitionLazyLoader
from
.caching_descriptor_system
import
CachingDescriptorSystem
from
.caching_descriptor_system
import
CachingDescriptorSystem
...
@@ -62,14 +61,11 @@ class SplitMongoModuleStore(ModuleStoreBase):
...
@@ -62,14 +61,11 @@ class SplitMongoModuleStore(ModuleStoreBase):
**
kwargs
**
kwargs
),
db
)
),
db
)
# TODO add caching of structures to thread_cache to prevent repeated fetches (but not index b/c
# it changes w/o having a change in id)
self
.
course_index
=
self
.
db
[
collection
+
'.active_versions'
]
self
.
course_index
=
self
.
db
[
collection
+
'.active_versions'
]
self
.
structures
=
self
.
db
[
collection
+
'.structures'
]
self
.
structures
=
self
.
db
[
collection
+
'.structures'
]
self
.
definitions
=
self
.
db
[
collection
+
'.definitions'
]
self
.
definitions
=
self
.
db
[
collection
+
'.definitions'
]
# ??? Code review question: those familiar w/ python threading. Should I instead
# Code review question: How should I expire entries?
# use django cache? How should I expire entries?
# _add_cache could use a lru mechanism to control the cache size?
# _add_cache could use a lru mechanism to control the cache size?
self
.
thread_cache
=
threading
.
local
()
self
.
thread_cache
=
threading
.
local
()
...
@@ -1178,6 +1174,7 @@ class SplitMongoModuleStore(ModuleStoreBase):
...
@@ -1178,6 +1174,7 @@ class SplitMongoModuleStore(ModuleStoreBase):
else
:
else
:
return
DescriptionLocator
(
definition
[
'_id'
])
return
DescriptionLocator
(
definition
[
'_id'
])
def
_block_matches
(
self
,
value
,
qualifiers
):
def
_block_matches
(
self
,
value
,
qualifiers
):
'''
'''
Return True or False depending on whether the value (block contents)
Return True or False depending on whether the value (block contents)
...
...
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