dashboard 增加编辑按钮

阅读更多
用到其他目录下的文件,用到workflows

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[^/]+)/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")

你可能感兴趣的:(workflow,dashboard,编辑,edit)