Skip to content

Commit

Permalink
add get_full_tree_title method
Browse files Browse the repository at this point in the history
  • Loading branch information
fngaha committed May 31, 2016
1 parent e3daf7c commit 2f69a15
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/collective/task/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,15 @@ def get_highest_task_parent(self, task=False):
return parent
obj = parent
return obj

def get_full_tree_title(self):
"""Returns the full title of the task tree
It is constituted by the list of the names of the tasks and parent task separated by slashes
e.g. for Bar task in Foo task : u" Foo/Bare
"""
obj = self.context
full_tree_title = obj.Title()
while ITask.providedBy(obj.aq_parent):
full_tree_title = obj.aq_parent.Title() + '/' + full_tree_title
obj = obj.aq_parent
return full_tree_title

0 comments on commit 2f69a15

Please sign in to comment.