From 2cff4cb5547f4f63a3feb4e7673493016ecef617 Mon Sep 17 00:00:00 2001 From: Luka Peschke Date: Fri, 1 Feb 2019 11:23:58 +0100 Subject: [PATCH] Import reverse from django.urls rather than django.core.urlresolvers Starting with Django 2 (which is the python3 version), the reverse and reverse_lazy functions are located in the django.urls module rather than django.core.urlresolvers. In Django>=1.10 (horizon depends on 1.11), these functions are available in django.urls. This commit aims at improving the python3 compatibility. Change-Id: I8e8d281c7cac21c4b5771d2430f7d376b7e8c46a --- cloudkittydashboard/dashboards/admin/hashmap/tables.py | 2 +- cloudkittydashboard/dashboards/admin/hashmap/views.py | 4 ++-- cloudkittydashboard/dashboards/admin/modules/tables.py | 2 +- cloudkittydashboard/dashboards/admin/modules/views.py | 4 ++-- cloudkittydashboard/dashboards/admin/pyscripts/tables.py | 2 +- cloudkittydashboard/dashboards/admin/pyscripts/views.py | 4 ++-- cloudkittydashboard/dashboards/admin/summary/tables.py | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cloudkittydashboard/dashboards/admin/hashmap/tables.py b/cloudkittydashboard/dashboards/admin/hashmap/tables.py index 4347845..c22becb 100644 --- a/cloudkittydashboard/dashboards/admin/hashmap/tables.py +++ b/cloudkittydashboard/dashboards/admin/hashmap/tables.py @@ -13,7 +13,7 @@ # under the License. from collections import OrderedDict -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/cloudkittydashboard/dashboards/admin/hashmap/views.py b/cloudkittydashboard/dashboards/admin/hashmap/views.py index 77bf6f1..7ba65bc 100644 --- a/cloudkittydashboard/dashboards/admin/hashmap/views.py +++ b/cloudkittydashboard/dashboards/admin/hashmap/views.py @@ -13,8 +13,8 @@ # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import forms from horizon import tables diff --git a/cloudkittydashboard/dashboards/admin/modules/tables.py b/cloudkittydashboard/dashboards/admin/modules/tables.py index a322bb0..8db05d9 100644 --- a/cloudkittydashboard/dashboards/admin/modules/tables.py +++ b/cloudkittydashboard/dashboards/admin/modules/tables.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/cloudkittydashboard/dashboards/admin/modules/views.py b/cloudkittydashboard/dashboards/admin/modules/views.py index e64e280..f516f11 100644 --- a/cloudkittydashboard/dashboards/admin/modules/views.py +++ b/cloudkittydashboard/dashboards/admin/modules/views.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import forms from horizon import tables diff --git a/cloudkittydashboard/dashboards/admin/pyscripts/tables.py b/cloudkittydashboard/dashboards/admin/pyscripts/tables.py index 004668a..475d36d 100644 --- a/cloudkittydashboard/dashboards/admin/pyscripts/tables.py +++ b/cloudkittydashboard/dashboards/admin/pyscripts/tables.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy diff --git a/cloudkittydashboard/dashboards/admin/pyscripts/views.py b/cloudkittydashboard/dashboards/admin/pyscripts/views.py index 0de50f8..f37993a 100644 --- a/cloudkittydashboard/dashboards/admin/pyscripts/views.py +++ b/cloudkittydashboard/dashboards/admin/pyscripts/views.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse -from django.core.urlresolvers import reverse_lazy +from django.urls import reverse +from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import forms from horizon import tables diff --git a/cloudkittydashboard/dashboards/admin/summary/tables.py b/cloudkittydashboard/dashboards/admin/summary/tables.py index dcb1507..8b97c36 100644 --- a/cloudkittydashboard/dashboards/admin/summary/tables.py +++ b/cloudkittydashboard/dashboards/admin/summary/tables.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import tables