# Path: mistraldashboard/api.py
# SERVICE_TYPE = 'workflowv2'
# def mistralclient(request):
# def pagination_list(entity, request, marker='', sort_keys='', sort_dirs='asc',
#                     paginate=False, reversed_order=False, selector=None):
# def execution_create(request, **data):
# def execution_get(request, execution_id):
# def execution_update(request, execution_id, field, value):
# def execution_delete(request, execution_name):
# def task_list(request, execution_id=None):
# def task_get(request, task_id=None):
# def workflow_list(request):
# def workflow_get(request, workflow_name):
# def workflow_create(request, workflows_definition):
# def workflow_validate(request, workflow_definition):
# def workflow_delete(request, workflow_name):
# def workflow_update(request, workflows_definition):
# def workbook_list(request):
# def workbook_get(request, workbook_name):
# def workbook_create(request, workbook_definition):
# def workbook_validate(request, workbook_definition):
# def workbook_delete(request, workbook_name):
# def workbook_update(request, workbook_definition):
# def action_list(request):
# def action_get(request, action_name):
# def action_create(request, action_definition):
# def action_update(request, action_definition):
# def action_run(request, action_name, input, params):
# def action_delete(request, action_name):
# def action_executions_list(request, task_execution_id=None):
# def action_execution_get(request, action_execution_id):
# def action_execution_delete(request, action_execution_id):
# def action_execution_update(request, id, state=None, output=None):
# def cron_trigger_list(request):
# def cron_trigger_get(request, cron_trigger_name):
# def cron_trigger_delete(request, cron_trigger_name):
# def cron_trigger_create(
#     request,
#     cron_trigger_name,
#     workflow_ID,
#     workflow_input,
#     workflow_params,
#     pattern,
#     first_time,
#     count
# ):
# 
# Path: mistraldashboard/default/smart_cell.py
# def get_data(self, datum, column, row):
# def init():
# 
# Path: mistraldashboard/default/utils.py
# def humantime(x):
#     return render_to_string("mistral/default/_humantime.html",
#                             {"datetime": iso8601.parse_date(x)})
# 
# Path: mistraldashboard/default/utils.py
# def label(x):
#     return render_to_string("mistral/default/_label.html",
#                             {"label": x,
#                              "type": TYPES.get(x)})


from django.template.defaultfilters import title
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tables
from mistraldashboard import api
from mistraldashboard.default import smart_cell
from mistraldashboard.default.utils import humantime
from mistraldashboard.default.utils import label
        obj_id = datum.id
        url = ""
        action_execution_url = "horizon:mistral:action_executions:task"
        workflow_execution_url = "horizon:mistral:executions:tasks"
        if datum.type == "ACTION":
            url = action_execution_url
        elif datum.type == "WORKFLOW":
            url = workflow_execution_url

        return reverse(url, args=[obj_id])


class TaskTable(tables.DataTable):

    def getHoverHelp(data):
        if hasattr(data, 'state_info') and data.state_info:
            return {'title': data.state_info}

    STATE_STATUS_CHOICES = (
        ("success", True),
        ("error", False),
        ("idle", None),
        ("running", None),
    )

    id = tables.Column(
        "id",
        verbose_name=_("ID"),
        link="horizon:mistral:tasks:detail"
    )

# Path: mistraldashboard/api.py
# SERVICE_TYPE = 'workflowv2'
# def mistralclient(request):
# def pagination_list(entity, request, marker='', sort_keys='', sort_dirs='asc',
#                     paginate=False, reversed_order=False, selector=None):
# def execution_create(request, **data):
# def execution_get(request, execution_id):
# def execution_update(request, execution_id, field, value):
# def execution_delete(request, execution_name):
# def task_list(request, execution_id=None):
# def task_get(request, task_id=None):
# def workflow_list(request):
# def workflow_get(request, workflow_name):
# def workflow_create(request, workflows_definition):
# def workflow_validate(request, workflow_definition):
# def workflow_delete(request, workflow_name):
# def workflow_update(request, workflows_definition):
# def workbook_list(request):
# def workbook_get(request, workbook_name):
# def workbook_create(request, workbook_definition):
# def workbook_validate(request, workbook_definition):
# def workbook_delete(request, workbook_name):
# def workbook_update(request, workbook_definition):
# def action_list(request):
# def action_get(request, action_name):
# def action_create(request, action_definition):
# def action_update(request, action_definition):
# def action_run(request, action_name, input, params):
# def action_delete(request, action_name):
# def action_executions_list(request, task_execution_id=None):
# def action_execution_get(request, action_execution_id):
# def action_execution_delete(request, action_execution_id):
# def action_execution_update(request, id, state=None, output=None):
# def cron_trigger_list(request):
# def cron_trigger_get(request, cron_trigger_name):
# def cron_trigger_delete(request, cron_trigger_name):
# def cron_trigger_create(
#     request,
#     cron_trigger_name,
#     workflow_ID,
#     workflow_input,
#     workflow_params,
#     pattern,
#     first_time,
#     count
# ):
# 
# Path: mistraldashboard/default/smart_cell.py
# def get_data(self, datum, column, row):
# def init():
# 
# Path: mistraldashboard/default/utils.py
# def humantime(x):
#     return render_to_string("mistral/default/_humantime.html",
#                             {"datetime": iso8601.parse_date(x)})
# 
# Path: mistraldashboard/default/utils.py
# def label(x):
#     return render_to_string("mistral/default/_label.html",
#                             {"label": x,
#                              "type": TYPES.get(x)})


# Path: mistraldashboard/tasks/tables.py
from django.template.defaultfilters import title
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tables
from mistraldashboard import api
from mistraldashboard.default import smart_cell
from mistraldashboard.default.utils import humantime
from mistraldashboard.default.utils import label

        obj_id = datum.id
        url = ""
        action_execution_url = "horizon:mistral:action_executions:task"
        workflow_execution_url = "horizon:mistral:executions:tasks"
        if datum.type == "ACTION":
            url = action_execution_url
        elif datum.type == "WORKFLOW":
            url = workflow_execution_url

        return reverse(url, args=[obj_id])


class TaskTable(tables.DataTable):

    def getHoverHelp(data):
        if hasattr(data, 'state_info') and data.state_info:
            return {'title': data.state_info}

    STATE_STATUS_CHOICES = (
        ("success", True),
        ("error", False),
        ("idle", None),
        ("running", None),
    )

    id = tables.Column(
        "id",
        verbose_name=_("ID"),
        link="horizon:mistral:tasks:detail"
    )

    name = tables.Column(