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
b4793b32
Commit
b4793b32
authored
Dec 07, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an implementation of get_items to xml module store
parent
47ed02c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
common/lib/xmodule/xmodule/modulestore/xml.py
+12
-0
No files found.
common/lib/xmodule/xmodule/modulestore/xml.py
View file @
b4793b32
...
@@ -513,6 +513,18 @@ class XMLModuleStore(ModuleStoreBase):
...
@@ -513,6 +513,18 @@ class XMLModuleStore(ModuleStoreBase):
raise
NotImplementedError
(
"XMLModuleStores can't guarantee that definitions"
raise
NotImplementedError
(
"XMLModuleStores can't guarantee that definitions"
" are unique. Use get_instance."
)
" are unique. Use get_instance."
)
def
get_items
(
self
,
location
,
depth
=
0
):
items
=
[]
for
_
,
modules
in
self
.
modules
.
iteritems
():
for
mod_loc
,
module
in
modules
.
iteritems
():
# Locations match if each value in `location` is None or if the value from `location`
# matches the value from `mod_loc`
if
all
(
goal
is
None
or
goal
==
value
for
goal
,
value
in
zip
(
location
,
mod_loc
)):
items
.
append
(
module
)
return
items
def
get_courses
(
self
,
depth
=
0
):
def
get_courses
(
self
,
depth
=
0
):
"""
"""
...
...
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