Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
7b52d45a
Commit
7b52d45a
authored
10 years ago
by
Don Mitchell
Browse files
Options
Downloads
Patches
Plain Diff
Move edit info into xblock and runtime mixins
LMS-11183, LMS-11184
parent
c7d41833
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cms/envs/common.py
+2
-1
2 additions, 1 deletion
cms/envs/common.py
common/lib/xmodule/xmodule/modulestore/edit_info.py
+101
-0
101 additions, 0 deletions
common/lib/xmodule/xmodule/modulestore/edit_info.py
common/lib/xmodule/xmodule/x_module.py
+1
-1
1 addition, 1 deletion
common/lib/xmodule/xmodule/x_module.py
with
104 additions
and
2 deletions
cms/envs/common.py
+
2
−
1
View file @
7b52d45a
...
...
@@ -38,6 +38,7 @@ from warnings import simplefilter
from
lms.lib.xblock.mixin
import
LmsBlockMixin
from
dealer.git
import
git
from
xmodule.modulestore.edit_info
import
EditInfoMixin
############################ FEATURE CONFIGURATION #############################
...
...
@@ -254,7 +255,7 @@ from xmodule.x_module import XModuleMixin
# This should be moved into an XBlock Runtime/Application object
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
XBLOCK_MIXINS
=
(
LmsBlockMixin
,
InheritanceMixin
,
XModuleMixin
)
XBLOCK_MIXINS
=
(
LmsBlockMixin
,
InheritanceMixin
,
XModuleMixin
,
EditInfoMixin
)
# Allow any XBlock in Studio
# You should also enable the ALLOW_ALL_ADVANCED_COMPONENTS feature flag, so that
...
...
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/modulestore/edit_info.py
0 → 100644
+
101
−
0
View file @
7b52d45a
"""
Access methods to get EditInfo for xblocks
"""
from
xblock.fields
import
XBlockMixin
from
abc
import
ABCMeta
,
abstractmethod
class
EditInfoMixin
(
XBlockMixin
):
"""
Provides the interfaces for getting the edit info from XBlocks
"""
@property
def
edited_by
(
self
):
"""
The user id of the last user to change this xblock content, children, or settings.
"""
return
self
.
runtime
.
get_edited_by
(
self
)
@property
def
edited_on
(
self
):
"""
The datetime of the last change to this xblock content, children, or settings.
"""
return
self
.
runtime
.
get_edited_on
(
self
)
@property
def
subtree_edited_by
(
self
):
"""
The user id of the last user to change content, children, or settings in this xblock
'
s subtree
"""
return
self
.
runtime
.
get_subtree_edited_by
(
self
)
@property
def
subtree_edited_on
(
self
):
"""
The datetime of the last change content, children, or settings in this xblock
'
s subtree
"""
return
self
.
runtime
.
get_subtree_edited_on
(
self
)
@property
def
published_by
(
self
):
"""
The user id of the last user to publish this specific xblock (or a previous version of it).
"""
return
self
.
runtime
.
get_published_by
(
self
)
@property
def
published_on
(
self
):
"""
The datetime of the last time this specific xblock was published.
"""
return
self
.
runtime
.
get_published_on
(
self
)
class
EditInfoRuntimeMixin
(
object
):
"""
An abstract mixin class for the functions which the :class: `EditInfoMixin` methods call on the runtime
"""
__metaclass__
=
ABCMeta
@abstractmethod
def
get_edited_by
(
self
,
xblock
):
"""
The datetime of the last change to this xblock content, children, or settings.
"""
pass
@abstractmethod
def
get_edited_on
(
self
,
xblock
):
"""
The datetime of the last change to this xblock content, children, or settings.
"""
pass
@abstractmethod
def
get_subtree_edited_by
(
self
,
xblock
):
"""
The user id of the last user to change content, children, or settings in this xblock
'
s subtree
"""
pass
@abstractmethod
def
get_subtree_edited_on
(
self
,
xblock
):
"""
The datetime of the last change content, children, or settings in this xblock
'
s subtree
"""
pass
@abstractmethod
def
get_published_by
(
self
,
xblock
):
"""
The user id of the last user to publish this specific xblock (or a previous version of it).
"""
pass
@abstractmethod
def
get_published_on
(
self
,
xblock
):
"""
The datetime of the last time this specific xblock was published.
"""
pass
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/x_module.py
+
1
−
1
View file @
7b52d45a
...
...
@@ -724,7 +724,7 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
# leaving off original_version since it complicates creation w/o any obv value yet and is computable
# by following previous until None
# definition_locator is only used by mongostores which separate definitions from blocks
self
.
edited_by
=
self
.
edited_on
=
self
.
previous_version
=
self
.
update_version
=
self
.
definition_locator
=
None
self
.
previous_version
=
self
.
update_version
=
self
.
definition_locator
=
None
self
.
xmodule_runtime
=
None
@classmethod
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment