def query_task(cls, only_latest=True, reverse=None, order_by=None, **kwargs) -> typing.List[Task]: tasks = Task.query(reverse=reverse, order_by=order_by, **kwargs) if only_latest: tasks_group = cls.get_latest_tasks(tasks=tasks) return list(tasks_group.values()) else: return tasks
def get_tasks_asc(cls, job_id, role, party_id): tasks = Task.query(order_by="create_time", reverse=False, job_id=job_id, role=role, party_id=party_id) tasks_group = cls.get_latest_tasks(tasks=tasks) return tasks_group