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
67d2ef6e
Commit
67d2ef6e
authored
Aug 18, 2017
by
Adam Palay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
have coursegraph cache nodes on block_ids rather than locations (EDUCATOR-1133)
parent
36e4c801
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
openedx/core/djangoapps/coursegraph/tasks.py
+6
-5
No files found.
openedx/core/djangoapps/coursegraph/tasks.py
View file @
67d2ef6e
...
@@ -167,17 +167,18 @@ def serialize_course(course_id):
...
@@ -167,17 +167,18 @@ def serialize_course(course_id):
fields
[
field_name
]
=
coerce_types
(
value
)
fields
[
field_name
]
=
coerce_types
(
value
)
node
=
Node
(
block_type
,
'item'
,
**
fields
)
node
=
Node
(
block_type
,
'item'
,
**
fields
)
location_to_node
[
item
.
location
]
=
node
location_to_node
[
item
.
location
.
block_id
]
=
node
# create relationships
# create relationships
relationships
=
[]
relationships
=
[]
for
item
in
items
:
for
item
in
items
:
previous_child_node
=
None
previous_child_node
=
None
for
index
,
child_loc
in
enumerate
(
item
.
get_children
()):
for
index
,
child
in
enumerate
(
item
.
get_children
()):
parent_node
=
location_to_node
.
get
(
item
.
location
)
parent_node
=
location_to_node
.
get
(
item
.
location
.
block_id
)
child_node
=
location_to_node
.
get
(
child_loc
.
location
)
child_node
=
location_to_node
.
get
(
child
.
location
.
block_id
)
child_node
[
"index"
]
=
index
if
parent_node
is
not
None
and
child_node
is
not
None
:
if
parent_node
is
not
None
and
child_node
is
not
None
:
child_node
[
"index"
]
=
index
relationship
=
Relationship
(
parent_node
,
"PARENT_OF"
,
child_node
)
relationship
=
Relationship
(
parent_node
,
"PARENT_OF"
,
child_node
)
relationships
.
append
(
relationship
)
relationships
.
append
(
relationship
)
...
...
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