Commit 904541ef authored by David Douard's avatar David Douard
Browse files

[entities] add a CeleryTask.parent_tasks property

that returns an iterator on all parents recursively
parent 0471b401be35
......@@ -121,6 +121,13 @@ class CeleryTask(AnyEntity):
for subtask in self.reverse_parent_task:
yield subtask.progress
def parent_tasks(self):
yield self
for task in self.parent_task:
for ptask in task.parent_tasks:
yield ptask
class ICeleryTask(EntityAdapter):
__regid__ = 'ICeleryTask'
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