Commit 87c6516c authored by Mathieu Rodic's avatar Mathieu Rodic

Upgraded from "treebeard" to "cte_tree"

parent c5fb86a8
...@@ -84,7 +84,7 @@ class FileParser: ...@@ -84,7 +84,7 @@ class FileParser:
resource = Resource(guid=guid) resource = Resource(guid=guid)
# If the parent node already has a child with this resource, pass # If the parent node already has a child with this resource, pass
# (is it a good thing?) # (is it a good thing?)
if parentNode.get_descendants().filter(resource=resource).exists(): if parentNode.descendants().filter(resource=resource).exists():
return None return None
# create the document itself # create the document itself
childNode = Node( childNode = Node(
...@@ -93,9 +93,9 @@ class FileParser: ...@@ -93,9 +93,9 @@ class FileParser:
name = title, name = title,
language = language, language = language,
metadata = metadata, metadata = metadata,
resource = resource resource = resource,
parent = parentNode
) )
parentNode.add_child(childNode)
# parse it! # parse it!
ngrams = self.extract_ngrams(contents, language) ngrams = self.extract_ngrams(contents, language)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment