Clean imports in code

This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: I68edb2a90c560b9c485ec4832af65c777e6e7b6c
This commit is contained in:
Cao Xuan Hoang 2016-09-08 15:25:30 +07:00
parent ce8ae703dd
commit 96bee8d9cc
7 changed files with 21 additions and 21 deletions

View File

@ -22,7 +22,7 @@ from horizon import forms
from horizon import tables
from mistraldashboard.actions import forms as mistral_forms
from mistraldashboard.actions.tables import ActionsTable
from mistraldashboard.actions import tables as mistral_tables
from mistraldashboard import api
@ -50,7 +50,7 @@ class UpdateView(forms.ModalFormView):
class IndexView(tables.DataTableView):
table_id = "workflow_action"
table_class = ActionsTable
table_class = mistral_tables.ActionsTable
template_name = 'mistral/actions/index.html'
def has_prev_data(self, table):
@ -62,7 +62,7 @@ class IndexView(tables.DataTableView):
def get_data(self):
actions = []
prev_marker = self.request.GET.get(
ActionsTable._meta.prev_pagination_param,
mistral_tables.ActionsTable._meta.prev_pagination_param,
None
)
@ -72,7 +72,7 @@ class IndexView(tables.DataTableView):
else:
sort_dir = 'desc'
marker = self.request.GET.get(
ActionsTable._meta.pagination_param,
mistral_tables.ActionsTable._meta.pagination_param,
None
)

View File

@ -23,7 +23,7 @@ from horizon import tables
from mistraldashboard import api
from mistraldashboard.cron_triggers import forms as mistral_forms
from mistraldashboard.cron_triggers.tables import CronTriggersTable
from mistraldashboard.cron_triggers import tables as mistral_tables
class OverviewView(generic.TemplateView):
@ -66,7 +66,7 @@ class CreateView(forms.ModalFormView):
class IndexView(tables.DataTableView):
table_class = CronTriggersTable
table_class = mistral_tables.CronTriggersTable
template_name = 'mistral/cron_triggers/index.html'
def get_data(self):

View File

@ -16,7 +16,7 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from mistraldashboard.default.panel import Default
from mistraldashboard.default import panel
class MistralDashboard(horizon.Dashboard):
@ -36,4 +36,4 @@ class MistralDashboard(horizon.Dashboard):
horizon.register(MistralDashboard)
MistralDashboard.register(Default)
MistralDashboard.register(panel.Default)

View File

@ -20,7 +20,7 @@
from django import forms
from django import template
from horizon.tables.base import Cell
from horizon.tables import base
import six
@ -78,4 +78,4 @@ def get_data(self, datum, column, row):
def init():
Cell.get_data = get_data
base.Cell.get_data = get_data

View File

@ -26,8 +26,8 @@ from horizon import tables
from mistraldashboard import api
from mistraldashboard.default.utils import prettyprint
from mistraldashboard.executions.forms import UpdateDescriptionForm
from mistraldashboard.executions.tables import ExecutionsTable
from mistraldashboard.executions import forms as m_forms
from mistraldashboard.executions import tables as mistral_tables
from mistraldashboard import forms as mistral_forms
@ -71,7 +71,7 @@ def get_single_data(request, id, type="execution"):
class IndexView(tables.DataTableView):
table_class = ExecutionsTable
table_class = mistral_tables.ExecutionsTable
template_name = 'mistral/executions/index.html'
def has_prev_data(self, table):
@ -83,7 +83,7 @@ class IndexView(tables.DataTableView):
def get_data(self):
executions = []
prev_marker = self.request.GET.get(
ExecutionsTable._meta.prev_pagination_param,
mistral_tables.ExecutionsTable._meta.prev_pagination_param,
None
)
@ -93,7 +93,7 @@ class IndexView(tables.DataTableView):
else:
sort_dir = 'desc'
marker = self.request.GET.get(
ExecutionsTable._meta.pagination_param,
mistral_tables.ExecutionsTable._meta.pagination_param,
None
)
@ -202,7 +202,7 @@ class UpdateDescriptionView(forms.ModalFormView):
template_name = 'mistral/executions/update_description.html'
modal_header = _("Update Execution Description")
form_id = "update_execution_description"
form_class = UpdateDescriptionForm
form_class = m_forms.UpdateDescriptionForm
submit_label = _("Update")
success_url = reverse_lazy("horizon:mistral:executions:index")
submit_url = "horizon:mistral:executions:update_description"

View File

@ -27,7 +27,7 @@ from horizon import tables
from mistraldashboard import api
from mistraldashboard.default.utils import prettyprint
from mistraldashboard import forms as mistral_forms
from mistraldashboard.tasks.tables import TaskTable
from mistraldashboard.tasks import tables as mistral_tables
def get_single_task_data(request, **kwargs):
@ -43,7 +43,7 @@ def get_single_task_data(request, **kwargs):
class ExecutionView(tables.DataTableView):
table_class = TaskTable
table_class = mistral_tables.TaskTable
template_name = 'mistral/tasks/filtered.html'
def get_data(self, **kwargs):
@ -106,7 +106,7 @@ class CodeView(forms.ModalFormView):
class IndexView(tables.DataTableView):
table_class = TaskTable
table_class = mistral_tables.TaskTable
template_name = 'mistral/tasks/index.html'
def get_data(self):

View File

@ -25,11 +25,11 @@ from horizon import tables
from mistraldashboard import api
from mistraldashboard.workbooks import forms as mistral_forms
from mistraldashboard.workbooks.tables import WorkbooksTable
from mistraldashboard.workbooks import tables as mistral_tables
class IndexView(tables.DataTableView):
table_class = WorkbooksTable
table_class = mistral_tables.WorkbooksTable
template_name = 'mistral/workbooks/index.html'
def get_data(self):