if deepest_level == depth:
# This should happen if nothing is found with any part of the given path.
+ if root is not None:
+ return root, build_path(segments)
raise
return find_obj(segments, depth, deepest_found)
slug = models.SlugField(max_length=255)
def get_path(self, root=None, pathsep='/', field='slug'):
+ if root == self:
+ return ''
+
if root is not None and not self.is_descendant_of(root):
raise AncestorDoesNotExist(root)