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
d77491e4
Commit
d77491e4
authored
Sep 06, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pull XModule attributes out into a mixin that can be applied to xblocks
parent
f4dd5082
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
15 deletions
+13
-15
cms/envs/common.py
+2
-1
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+0
-2
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py
+2
-1
common/lib/xmodule/xmodule/tests/__init__.py
+2
-6
common/lib/xmodule/xmodule/tests/test_import.py
+2
-1
common/lib/xmodule/xmodule/tests/test_xml_module.py
+3
-3
common/lib/xmodule/xmodule/x_module.py
+0
-0
lms/envs/common.py
+2
-1
No files found.
cms/envs/common.py
View file @
d77491e4
...
@@ -31,6 +31,7 @@ from path import path
...
@@ -31,6 +31,7 @@ from path import path
from
lms.xblock.mixin
import
LmsBlockMixin
from
lms.xblock.mixin
import
LmsBlockMixin
from
cms.xmodule_namespace
import
CmsBlockMixin
from
cms.xmodule_namespace
import
CmsBlockMixin
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.x_module
import
XModuleMixin
############################ FEATURE CONFIGURATION #############################
############################ FEATURE CONFIGURATION #############################
...
@@ -168,7 +169,7 @@ MIDDLEWARE_CLASSES = (
...
@@ -168,7 +169,7 @@ MIDDLEWARE_CLASSES = (
# This should be moved into an XBlock Runtime/Application object
# This should be moved into an XBlock Runtime/Application object
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
XBLOCK_MIXINS
=
(
LmsBlockMixin
,
CmsBlockMixin
,
InheritanceMixin
)
XBLOCK_MIXINS
=
(
LmsBlockMixin
,
CmsBlockMixin
,
InheritanceMixin
,
XModuleMixin
)
############################ SIGNAL HANDLERS ################################
############################ SIGNAL HANDLERS ################################
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
d77491e4
...
@@ -43,8 +43,6 @@ log = logging.getLogger(__name__)
...
@@ -43,8 +43,6 @@ log = logging.getLogger(__name__)
#==============================================================================
#==============================================================================
class
SplitMongoModuleStore
(
ModuleStoreBase
):
class
SplitMongoModuleStore
(
ModuleStoreBase
):
"""
"""
A Mongodb backed ModuleStore supporting versions, inheritance,
A Mongodb backed ModuleStore supporting versions, inheritance,
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py
View file @
d77491e4
...
@@ -15,6 +15,7 @@ from xmodule.modulestore.exceptions import InsufficientSpecificationError, ItemN
...
@@ -15,6 +15,7 @@ from xmodule.modulestore.exceptions import InsufficientSpecificationError, ItemN
DuplicateItemError
DuplicateItemError
from
xmodule.modulestore.locator
import
CourseLocator
,
BlockUsageLocator
,
VersionTree
,
DescriptionLocator
from
xmodule.modulestore.locator
import
CourseLocator
,
BlockUsageLocator
,
VersionTree
,
DescriptionLocator
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.x_module
import
XModuleMixin
from
pytz
import
UTC
from
pytz
import
UTC
from
path
import
path
from
path
import
path
import
re
import
re
...
@@ -34,7 +35,7 @@ class SplitModuleTest(unittest.TestCase):
...
@@ -34,7 +35,7 @@ class SplitModuleTest(unittest.TestCase):
'db'
:
'test_xmodule'
,
'db'
:
'test_xmodule'
,
'collection'
:
'modulestore{0}'
.
format
(
uuid
.
uuid4
()
.
hex
),
'collection'
:
'modulestore{0}'
.
format
(
uuid
.
uuid4
()
.
hex
),
'fs_root'
:
''
,
'fs_root'
:
''
,
'xblock_mixins'
:
(
InheritanceMixin
,)
'xblock_mixins'
:
(
InheritanceMixin
,
XModuleMixin
)
}
}
MODULESTORE
=
{
MODULESTORE
=
{
...
...
common/lib/xmodule/xmodule/tests/__init__.py
View file @
d77491e4
...
@@ -11,15 +11,11 @@ import json
...
@@ -11,15 +11,11 @@ import json
import
os
import
os
import
unittest
import
unittest
import
fs
import
fs.osfs
import
numpy
from
mock
import
Mock
from
mock
import
Mock
from
path
import
path
from
path
import
path
import
calc
from
xblock.field_data
import
DictFieldData
from
xblock.field_data
import
DictFieldData
from
xmodule.x_module
import
ModuleSystem
,
XModuleDescriptor
,
DescriptorSystem
from
xmodule.x_module
import
ModuleSystem
,
XModuleDescriptor
,
XModuleMixin
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.mako_module
import
MakoDescriptorSystem
from
xmodule.mako_module
import
MakoDescriptorSystem
...
@@ -81,7 +77,7 @@ def get_test_descriptor_system():
...
@@ -81,7 +77,7 @@ def get_test_descriptor_system():
resources_fs
=
Mock
(),
resources_fs
=
Mock
(),
error_tracker
=
Mock
(),
error_tracker
=
Mock
(),
render_template
=
lambda
template
,
context
:
repr
(
context
),
render_template
=
lambda
template
,
context
:
repr
(
context
),
mixins
=
(
InheritanceMixin
,),
mixins
=
(
InheritanceMixin
,
XModuleMixin
),
)
)
...
...
common/lib/xmodule/xmodule/tests/test_import.py
View file @
d77491e4
...
@@ -13,6 +13,7 @@ from xmodule.xml_module import is_pointer_tag
...
@@ -13,6 +13,7 @@ from xmodule.xml_module import is_pointer_tag
from
xmodule.modulestore
import
Location
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.xml
import
ImportSystem
,
XMLModuleStore
from
xmodule.modulestore.xml
import
ImportSystem
,
XMLModuleStore
from
xmodule.modulestore.inheritance
import
compute_inherited_metadata
from
xmodule.modulestore.inheritance
import
compute_inherited_metadata
from
xmodule.x_module
import
XModuleMixin
from
xmodule.fields
import
Date
from
xmodule.fields
import
Date
from
xmodule.tests
import
DATA_DIR
from
xmodule.tests
import
DATA_DIR
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.modulestore.inheritance
import
InheritanceMixin
...
@@ -42,7 +43,7 @@ class DummySystem(ImportSystem):
...
@@ -42,7 +43,7 @@ class DummySystem(ImportSystem):
error_tracker
=
error_tracker
,
error_tracker
=
error_tracker
,
parent_tracker
=
parent_tracker
,
parent_tracker
=
parent_tracker
,
load_error_modules
=
load_error_modules
,
load_error_modules
=
load_error_modules
,
mixins
=
(
InheritanceMixin
,)
mixins
=
(
InheritanceMixin
,
XModuleMixin
)
)
)
def
render_template
(
self
,
_template
,
_context
):
def
render_template
(
self
,
_template
,
_context
):
...
...
common/lib/xmodule/xmodule/tests/test_xml_module.py
View file @
d77491e4
...
@@ -12,10 +12,10 @@ from xblock.runtime import DbModel
...
@@ -12,10 +12,10 @@ from xblock.runtime import DbModel
from
xmodule.fields
import
Date
,
Timedelta
from
xmodule.fields
import
Date
,
Timedelta
from
xmodule.modulestore.inheritance
import
InheritanceKeyValueStore
,
InheritanceMixin
from
xmodule.modulestore.inheritance
import
InheritanceKeyValueStore
,
InheritanceMixin
from
xmodule.x_module
import
XModuleFields
from
xmodule.xml_module
import
XmlDescriptor
,
serialize_field
,
deserialize_field
from
xmodule.xml_module
import
XmlDescriptor
,
serialize_field
,
deserialize_field
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.seq_module
import
SequenceDescriptor
from
xmodule.seq_module
import
SequenceDescriptor
from
xmodule.x_module
import
XModuleMixin
from
xmodule.tests
import
get_test_descriptor_system
from
xmodule.tests
import
get_test_descriptor_system
from
xmodule.tests.xml
import
XModuleXmlImportTest
from
xmodule.tests.xml
import
XModuleXmlImportTest
...
@@ -65,7 +65,7 @@ class EditableMetadataFieldsTest(unittest.TestCase):
...
@@ -65,7 +65,7 @@ class EditableMetadataFieldsTest(unittest.TestCase):
# Also tests that xml_attributes is filtered out of XmlDescriptor.
# Also tests that xml_attributes is filtered out of XmlDescriptor.
self
.
assertEqual
(
1
,
len
(
editable_fields
),
editable_fields
)
self
.
assertEqual
(
1
,
len
(
editable_fields
),
editable_fields
)
self
.
assert_field_values
(
self
.
assert_field_values
(
editable_fields
,
'display_name'
,
XModule
Fields
.
display_name
,
editable_fields
,
'display_name'
,
XModule
Mixin
.
display_name
,
explicitly_set
=
False
,
value
=
None
,
default_value
=
None
explicitly_set
=
False
,
value
=
None
,
default_value
=
None
)
)
...
@@ -73,7 +73,7 @@ class EditableMetadataFieldsTest(unittest.TestCase):
...
@@ -73,7 +73,7 @@ class EditableMetadataFieldsTest(unittest.TestCase):
# Tests that explicitly_set is correct when a value overrides the default (not inheritable).
# Tests that explicitly_set is correct when a value overrides the default (not inheritable).
editable_fields
=
self
.
get_xml_editable_fields
(
DictFieldData
({
'display_name'
:
'foo'
}))
editable_fields
=
self
.
get_xml_editable_fields
(
DictFieldData
({
'display_name'
:
'foo'
}))
self
.
assert_field_values
(
self
.
assert_field_values
(
editable_fields
,
'display_name'
,
XModule
Fields
.
display_name
,
editable_fields
,
'display_name'
,
XModule
Mixin
.
display_name
,
explicitly_set
=
True
,
value
=
'foo'
,
default_value
=
None
explicitly_set
=
True
,
value
=
'foo'
,
default_value
=
None
)
)
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
d77491e4
This diff is collapsed.
Click to expand it.
lms/envs/common.py
View file @
d77491e4
...
@@ -32,6 +32,7 @@ from .discussionsettings import *
...
@@ -32,6 +32,7 @@ from .discussionsettings import *
from
lms.xblock.mixin
import
LmsBlockMixin
from
lms.xblock.mixin
import
LmsBlockMixin
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.modulestore.inheritance
import
InheritanceMixin
from
xmodule.x_module
import
XModuleMixin
################################### FEATURES ###################################
################################### FEATURES ###################################
# The display name of the platform to be used in templates/emails/etc.
# The display name of the platform to be used in templates/emails/etc.
...
@@ -363,7 +364,7 @@ CONTENTSTORE = None
...
@@ -363,7 +364,7 @@ CONTENTSTORE = None
# This should be moved into an XBlock Runtime/Application object
# This should be moved into an XBlock Runtime/Application object
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
XBLOCK_MIXINS
=
(
LmsBlockMixin
,
InheritanceMixin
)
XBLOCK_MIXINS
=
(
LmsBlockMixin
,
InheritanceMixin
,
XModuleMixin
)
#################### Python sandbox ############################################
#################### Python sandbox ############################################
...
...
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