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
f77c3512
Commit
f77c3512
authored
Nov 22, 2016
by
Adam
Committed by
GitHub
Nov 22, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14035 from edx/adam/neo4j-add-detached-field
specify if an item is detached
parents
5b432ede
ed713d7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
openedx/core/djangoapps/coursegraph/management/commands/dump_to_neo4j.py
+4
-2
openedx/core/djangoapps/coursegraph/management/commands/tests/test_dump_to_neo4j.py
+2
-0
No files found.
openedx/core/djangoapps/coursegraph/management/commands/dump_to_neo4j.py
View file @
f77c3512
...
...
@@ -13,6 +13,7 @@ from py2neo import Graph, Node, Relationship, authenticate, NodeSelector
from
py2neo.compat
import
integer
,
string
,
unicode
as
neo4j_unicode
from
request_cache.middleware
import
RequestCache
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.store_utilities
import
DETACHED_XBLOCK_TYPES
from
openedx.core.djangoapps.content.course_structures.models
import
CourseStructure
...
...
@@ -73,6 +74,7 @@ class ModuleStoreSerializer(object):
)
course_key
=
item
.
scope_ids
.
usage_id
.
course_key
block_type
=
item
.
scope_ids
.
block_type
# set or reset some defaults
fields
[
'edited_on'
]
=
six
.
text_type
(
getattr
(
item
,
'edited_on'
,
''
))
...
...
@@ -82,8 +84,8 @@ class ModuleStoreSerializer(object):
fields
[
'run'
]
=
course_key
.
run
fields
[
'course_key'
]
=
six
.
text_type
(
course_key
)
fields
[
'location'
]
=
six
.
text_type
(
item
.
location
)
block_type
=
item
.
scope_ids
.
block_type
fields
[
'block_type'
]
=
block_type
fields
[
'detached'
]
=
block_type
in
DETACHED_XBLOCK_TYPES
if
block_type
==
'course'
:
# prune the checklists field
...
...
openedx/core/djangoapps/coursegraph/management/commands/tests/test_dump_to_neo4j.py
View file @
f77c3512
...
...
@@ -218,6 +218,8 @@ class TestModuleStoreSerializer(TestDumpToNeo4jCommandBase):
self
.
assertIn
(
"run"
,
fields
.
keys
())
self
.
assertIn
(
"course_key"
,
fields
.
keys
())
self
.
assertIn
(
"location"
,
fields
.
keys
())
self
.
assertIn
(
"block_type"
,
fields
.
keys
())
self
.
assertIn
(
"detached"
,
fields
.
keys
())
self
.
assertNotIn
(
"checklist"
,
fields
.
keys
())
def
test_serialize_course
(
self
):
...
...
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