@classmethod
    def check(cls, task_name, parent_id):
        # XXX(dcramer): we could make this fast if we're concerned about # of
        # rows by doing two network hops (first check for in progress, then
        # report result)
        child_tasks = list(db.session.query(
            cls.result, Task.status
        ).filter(
            cls.task_name == task_name,
            cls.parent_id == parent_id,
        ))
        if any(r.status != Status.finished for r in child_tasks):
            return Status.in_progress
        return Status.finished
>>> if Task.check('my_task', parent_item.id) == Status.finished:
dataset/ETHPy150Open dropbox/changes/changes/models/task.py/Task.check