From 5c622043ab986d0a4ad6968ac955342269bc6fec Mon Sep 17 00:00:00 2001 From: zhangguoqing Date: Fri, 29 Jan 2016 22:51:08 +0800 Subject: [PATCH] Update URLs to Django 1.8 style django.conf.urls.patterns() is deprecated since 1.8. We should not use patterns(), so this patch updates URLs to 1.8 style. Change-Id: Ida48baed98da4aeabdfdfc2f02b21bc588311161 Closes-Bug: #1539354 --- mistraldashboard/actions/urls.py | 6 ++---- mistraldashboard/cron_triggers/urls.py | 10 +++------- mistraldashboard/executions/urls.py | 6 ++---- mistraldashboard/tasks/urls.py | 6 ++---- mistraldashboard/test/urls.py | 5 ++--- mistraldashboard/workbooks/urls.py | 6 ++---- mistraldashboard/workflows/urls.py | 6 ++---- 7 files changed, 15 insertions(+), 30 deletions(-) diff --git a/mistraldashboard/actions/urls.py b/mistraldashboard/actions/urls.py index 75dae71..e1676de 100644 --- a/mistraldashboard/actions/urls.py +++ b/mistraldashboard/actions/urls.py @@ -12,18 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from mistraldashboard.actions import views ACTIONS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(ACTIONS % 'detail', views.DetailView.as_view(), name='detail'), url(ACTIONS % 'run', views.RunView.as_view(), name='run'), url(r'^create$', views.CreateView.as_view(), name='create'), url(r'^update$', views.UpdateView.as_view(), name='update'), -) +] diff --git a/mistraldashboard/cron_triggers/urls.py b/mistraldashboard/cron_triggers/urls.py index 24fc89d..6b32c42 100644 --- a/mistraldashboard/cron_triggers/urls.py +++ b/mistraldashboard/cron_triggers/urls.py @@ -12,18 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from mistraldashboard.cron_triggers import views CRON_TRIGGERS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(CRON_TRIGGERS % 'detail', views.OverviewView.as_view(), name='detail'), - url(r'^create$', - views.CreateView.as_view(), - name='create'), -) + url(r'^create$', views.CreateView.as_view(), name='create'), +] diff --git a/mistraldashboard/executions/urls.py b/mistraldashboard/executions/urls.py index 6218e04..78be001 100644 --- a/mistraldashboard/executions/urls.py +++ b/mistraldashboard/executions/urls.py @@ -14,15 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from mistraldashboard.executions import views EXECUTIONS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(EXECUTIONS % 'detail', views.DetailView.as_view(), name='detail'), url(EXECUTIONS % 'detail_task_id', views.DetailView.as_view(), @@ -34,4 +32,4 @@ urlpatterns = patterns( url(EXECUTIONS % 'update_description', views.UpdateDescriptionView.as_view(), name='update_description'), -) +] diff --git a/mistraldashboard/tasks/urls.py b/mistraldashboard/tasks/urls.py index 8fe0f99..52ac887 100644 --- a/mistraldashboard/tasks/urls.py +++ b/mistraldashboard/tasks/urls.py @@ -14,15 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from mistraldashboard.tasks import views TASKS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(TASKS % 'detail', views.OverviewView.as_view(), name='detail'), url(TASKS % 'execution', views.ExecutionView.as_view(), name='execution'), @@ -30,4 +28,4 @@ urlpatterns = patterns( {'column': 'result'}, name='result'), url(TASKS % 'published', views.CodeView.as_view(), {'column': 'published'}, name='published'), -) +] diff --git a/mistraldashboard/test/urls.py b/mistraldashboard/test/urls.py index 9bef20f..cf28475 100644 --- a/mistraldashboard/test/urls.py +++ b/mistraldashboard/test/urls.py @@ -14,7 +14,6 @@ from django.conf import urls import openstack_dashboard.urls -urlpatterns = urls.patterns( - '', +urlpatterns = [ urls.url(r'', urls.include(openstack_dashboard.urls)) -) +] diff --git a/mistraldashboard/workbooks/urls.py b/mistraldashboard/workbooks/urls.py index a5ce4ec..4c5d0d1 100644 --- a/mistraldashboard/workbooks/urls.py +++ b/mistraldashboard/workbooks/urls.py @@ -14,15 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from mistraldashboard.workbooks import views WORKBOOKS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^select_definition$', views.SelectDefinitionView.as_view(), @@ -33,4 +31,4 @@ urlpatterns = patterns( url(r'^create$', views.CreateView.as_view(), name='create'), url(r'^update$', views.UpdateView.as_view(), name='update'), url(WORKBOOKS % 'detail', views.DetailView.as_view(), name='detail'), -) +] diff --git a/mistraldashboard/workflows/urls.py b/mistraldashboard/workflows/urls.py index 7dbd509..4db21a6 100644 --- a/mistraldashboard/workflows/urls.py +++ b/mistraldashboard/workflows/urls.py @@ -14,15 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from mistraldashboard.workflows import views WORKFLOWS = r'^(?P[^/]+)/%s$' -urlpatterns = patterns( - '', +urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^select_definition$', views.SelectDefinitionView.as_view(), @@ -34,4 +32,4 @@ urlpatterns = patterns( url(r'^update$', views.UpdateView.as_view(), name='update'), url(WORKFLOWS % 'execute', views.ExecuteView.as_view(), name='execute'), url(WORKFLOWS % 'detail', views.DetailView.as_view(), name='detail'), -) +]