if not tasks:
return []
task_ids = tasks.split(",")
res = []
for task_id in task_ids:
task = TaskMeta.objects.filter(task_id=task_id)
if len(task) == 0:
continue // Task Not Finished
res.append(task[0])
return res
@staticmethod
def get_task_status(tasks):
After Change
task_ids = task_ids.split(",")
preserved = Case(*[
When(task_id=task_id, then=pos) for pos, task_id in enumerate(task_ids)])
return TaskMeta.objects.filter(task_id__in=task_ids).order_by(preserved)
@staticmethod
def get_task_status(tasks):
if not tasks: