用到其他目录下的文件,用到workflows
1.tables.py添加如下内容
2.urls.py
3.views.py
1.tables.py添加如下内容
from openstack_dashboard.dashboards.project.instances \
import tables as project_tables
class AdminEditInstance(project_tables.EditInstance):
url = "horizon:mydashboard:mypanel:update"
row_actions = (CreateSnapshotAction,DeleteSnapshotAction,AdminEditInstance)
2.urls.py
url(r'^(?P<instance_id>[^/]+)/update/$',
views.AdminUpdateView.as_view(),
name='update')
3.views.py
from openstack_dashboard.dashboards.project.instances import views as viewss //区别其他的views
from openstack_dashboard.dashboards.project.instances.workflows \
import update_instance
class AdminUpdateView(viewss.UpdateView):
workflow_class = update_instance.AdminUpdateInstance
success_url = reverse_lazy("horizon:mydashboard:mypanel:index")