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
3f420e3d
Commit
3f420e3d
authored
Dec 12, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loc_mapper memoize all translations
STUD-1048
parent
3bd76f98
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
7 deletions
+9
-7
cms/djangoapps/contentstore/tests/test_contentstore.py
+2
-3
common/lib/xmodule/xmodule/modulestore/django.py
+1
-1
common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py
+0
-0
common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py
+0
-0
common/lib/xmodule/xmodule/modulestore/tests/test_split_migrator.py
+4
-1
mongo_indexes.md
+2
-2
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
3f420e3d
...
...
@@ -7,7 +7,6 @@ from textwrap import dedent
from
django.test.utils
import
override_settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
path
import
path
from
tempdir
import
mkdtemp_clean
from
fs.osfs
import
OSFS
...
...
@@ -427,7 +426,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
course
=
module_store
.
get_item
(
course_location
)
num_tabs
=
len
(
course
.
tabs
)
last_tab
=
course
.
tabs
[
num_tabs
-
1
]
last_tab
=
course
.
tabs
[
-
1
]
url_slug
=
last_tab
[
'url_slug'
]
delete_url
=
self
.
_get_tab_locator
(
course
,
last_tab
)
.
url_reverse
(
'xblock'
)
...
...
@@ -446,7 +445,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
def
_get_tab_locator
(
self
,
course
,
tab
):
""" Returns the locator for a given tab. """
tab_location
=
'i4x://
MITx
/999/static_tab/{0}'
.
format
(
tab
[
'url_slug'
])
tab_location
=
'i4x://
edX
/999/static_tab/{0}'
.
format
(
tab
[
'url_slug'
])
return
loc_mapper
()
.
translate_location
(
course
.
location
.
course_id
,
Location
(
tab_location
),
False
,
True
)
...
...
common/lib/xmodule/xmodule/modulestore/django.py
View file @
3f420e3d
...
...
@@ -130,7 +130,7 @@ def loc_mapper():
# pylint: disable=W0212
if
_loc_singleton
is
None
:
# instantiate
_loc_singleton
=
LocMapperStore
(
**
settings
.
DOC_STORE_CONFIG
)
_loc_singleton
=
LocMapperStore
(
get_cache
(
'default'
),
**
settings
.
DOC_STORE_CONFIG
)
# inject into split mongo modulestore
if
'split'
in
_MODULESTORES
:
_MODULESTORES
[
'split'
]
.
loc_mapper
=
_loc_singleton
...
...
common/lib/xmodule/xmodule/modulestore/loc_mapper_store.py
View file @
3f420e3d
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/modulestore/tests/test_location_mapper.py
View file @
3f420e3d
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/modulestore/tests/test_split_migrator.py
View file @
3f420e3d
...
...
@@ -43,7 +43,10 @@ class TestMigration(unittest.TestCase):
def
setUp
(
self
):
super
(
TestMigration
,
self
)
.
setUp
()
self
.
loc_mapper
=
LocMapperStore
(
**
self
.
db_config
)
noop_cache
=
mock
.
Mock
(
spec
=
[
'get'
,
'set_many'
])
noop_cache
.
configure_mock
(
**
{
'get.return_value'
:
None
})
# pylint: disable=W0142
self
.
loc_mapper
=
LocMapperStore
(
noop_cache
,
**
self
.
db_config
)
self
.
old_mongo
=
MongoModuleStore
(
self
.
db_config
,
**
self
.
modulestore_options
)
self
.
draft_mongo
=
DraftModuleStore
(
self
.
db_config
,
**
self
.
modulestore_options
)
self
.
split_mongo
=
SplitMongoModuleStore
(
...
...
mongo_indexes.md
View file @
3f420e3d
...
...
@@ -16,6 +16,6 @@ location_map:
=============
```
ensureIndex({
'_id.org': 1, '_id.course': 1})
ensureIndex({
'course_id': 1})
ensureIndex({'_id.org': 1, '_id.course': 1})
ensureIndex({'course_id': 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