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
4ef53135
Commit
4ef53135
authored
Mar 03, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add and clean up __repr__ and __str__ for XModule-related things
parent
8fbb6432
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+16
-0
common/lib/xmodule/xmodule/x_module.py
+7
-2
lms/djangoapps/lms_xblock/field_data.py
+3
-0
No files found.
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
4ef53135
...
@@ -151,12 +151,28 @@ class MongoKeyValueStore(InheritanceKeyValueStore):
...
@@ -151,12 +151,28 @@ class MongoKeyValueStore(InheritanceKeyValueStore):
else
:
else
:
return
False
return
False
def
__repr__
(
self
):
return
"MongoKeyValueStore{!r}<{!r}, {!r}>"
.
format
(
(
self
.
_data
,
self
.
_parent
,
self
.
_children
,
self
.
_metadata
),
self
.
_fields
,
self
.
inherited_settings
)
class
CachingDescriptorSystem
(
MakoDescriptorSystem
,
EditInfoRuntimeMixin
):
class
CachingDescriptorSystem
(
MakoDescriptorSystem
,
EditInfoRuntimeMixin
):
"""
"""
A system that has a cache of module json that it will use to load modules
A system that has a cache of module json that it will use to load modules
from, with a backup of calling to the underlying modulestore for more data
from, with a backup of calling to the underlying modulestore for more data
"""
"""
def
__repr__
(
self
):
return
"CachingDescriptorSystem{!r}"
.
format
((
self
.
modulestore
,
unicode
(
self
.
course_id
),
[
unicode
(
key
)
for
key
in
self
.
module_data
.
keys
()],
self
.
default_class
,
[
unicode
(
key
)
for
key
in
self
.
cached_metadata
.
keys
()],
))
def
__init__
(
self
,
modulestore
,
course_key
,
module_data
,
default_class
,
cached_metadata
,
**
kwargs
):
def
__init__
(
self
,
modulestore
,
course_key
,
module_data
,
default_class
,
cached_metadata
,
**
kwargs
):
"""
"""
modulestore: the module store that can be used to retrieve additional modules
modulestore: the module store that can be used to retrieve additional modules
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
4ef53135
...
@@ -1596,8 +1596,13 @@ class ModuleSystem(MetricsMixin, ConfigurableFragmentWrapper, Runtime): # pylin
...
@@ -1596,8 +1596,13 @@ class ModuleSystem(MetricsMixin, ConfigurableFragmentWrapper, Runtime): # pylin
"""provide uniform access to attributes (like etree)"""
"""provide uniform access to attributes (like etree)"""
self
.
__dict__
[
attr
]
=
val
self
.
__dict__
[
attr
]
=
val
def
__str__
(
self
):
def
__repr__
(
self
):
return
str
(
self
.
__dict__
)
kwargs
=
self
.
__dict__
.
copy
()
# Remove value set transiently by XBlock
kwargs
.
pop
(
'_view_name'
)
return
"{}{}"
.
format
(
self
.
__class__
.
__name__
,
kwargs
)
@property
@property
def
ajax_url
(
self
):
def
ajax_url
(
self
):
...
...
lms/djangoapps/lms_xblock/field_data.py
View file @
4ef53135
...
@@ -33,3 +33,6 @@ class LmsFieldData(SplitFieldData):
...
@@ -33,3 +33,6 @@ class LmsFieldData(SplitFieldData):
Scope
.
user_info
:
student_data
,
Scope
.
user_info
:
student_data
,
Scope
.
preferences
:
student_data
,
Scope
.
preferences
:
student_data
,
})
})
def
__repr__
(
self
):
return
"LmsFieldData{!r}"
.
format
((
self
.
_authored_data
,
self
.
_student_data
))
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