def render_tasks(request, context): refresh_task_status() context['events'] = TEvent.objects.all() context['settings_queues'] = set(settings.TASK_NAMES_TO_QUEUE.values()) task_list = [] for k, v in settings.TASK_NAMES_TO_TYPE.iteritems(): task_list.append({'name': k, 'type': v, 'queue': settings.TASK_NAMES_TO_QUEUE[k], 'edges': settings.POST_OPERATION_TASKS[k] if k in settings.POST_OPERATION_TASKS else [] }) context['task_list'] = task_list context["videos"] = Video.objects.all().filter(parent_query__isnull=True) context['manual_tasks'] = settings.MANUAL_VIDEO_TASKS return render(request, 'tasks.html', context)
def get_context_data(self, **kwargs): refresh_task_status() context = super(TEventList, self).get_context_data(**kwargs) context['header'] = "" if self.kwargs.get('pk',None): context['video'] = Video.objects.get(pk=self.kwargs['pk']) context['header'] = "video/dataset : {}".format(context['video'].name) if self.kwargs.get('status',None): context['header'] += " with status {}".format(self.kwargs['status']) context['settings_queues'] = set(settings.TASK_NAMES_TO_QUEUE.values()) task_list = [] for k, v in settings.TASK_NAMES_TO_TYPE.iteritems(): task_list.append({'name': k, 'type': v, 'queue': settings.TASK_NAMES_TO_QUEUE[k], 'edges': [] }) context['task_list'] = task_list return context
def get_context_data(self, **kwargs): refresh_task_status() context = super(TEventList, self).get_context_data(**kwargs) context['header'] = "" if self.kwargs.get('pk',None): context['video'] = Video.objects.get(pk=self.kwargs['pk']) context['header'] = "video/dataset : {}".format(context['video'].name) if self.kwargs.get('status',None): context['header'] += " with status {}".format(self.kwargs['status']) context['settings_queues'] = set(settings.TASK_NAMES_TO_QUEUE.values()) task_list = [] for k, v in settings.TASK_NAMES_TO_TYPE.iteritems(): task_list.append({'name': k, 'type': v, 'queue': settings.TASK_NAMES_TO_QUEUE[k], 'edges': [] }) context['task_list'] = task_list return context