convert stx-gui to use django2
changed django.core.urlresolvers to django.urls added required app_name to urls.py Story: 2008454 Task: 42855 Signed-off-by: Daniel Safta <daniel.safta@windriver.com> Change-Id: Ic97d7571e600026c362818c356168f328dcd65bf
This commit is contained in:
parent
63d6de4701
commit
9322797df0
|
@ -18,7 +18,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from cgtsclient import exc as sysinv_exceptions
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.template import defaultfilters as filters
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
|
|
|
@ -26,3 +26,5 @@ RANGES = r'^(?P<providernet_range_id>[^/]+)/%s$'
|
|||
urlpatterns = [
|
||||
url(RANGES % 'detail', views.DetailView.as_view(),
|
||||
name='detail')]
|
||||
|
||||
app_name = 'detail'
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#
|
||||
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
|
|
|
@ -47,3 +47,5 @@ urlpatterns += [
|
|||
range_views.UpdateView.as_view(), name='editrange'),
|
||||
url(r'^ranges/',
|
||||
include(range_urls, namespace='ranges'))]
|
||||
|
||||
app_name = "ranges"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
from collections import OrderedDict
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse_lazy # noqa
|
||||
from django.urls import reverse_lazy # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
from collections import OrderedDict
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse_lazy # noqa
|
||||
from django.urls import reverse_lazy # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -10,8 +10,8 @@ import logging
|
|||
|
||||
from django.conf import settings
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
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.http import HttpResponse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.generic import View # noqa
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
import logging
|
||||
|
||||
from cgtsclient import exc
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import shortcuts
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import template
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import tables
|
||||
|
|
|
@ -10,7 +10,7 @@ import logging
|
|||
|
||||
import utils as icpu_utils
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import tables
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import tables
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django import shortcuts
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
import netaddr
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
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
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
|
||||
from horizon import forms
|
||||
from starlingx_dashboard.dashboards.admin.inventory.interfaces.address import \
|
||||
|
|
|
@ -6,16 +6,14 @@
|
|||
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
|
||||
import collections
|
||||
import logging
|
||||
|
||||
from compiler.ast import flatten
|
||||
import netaddr
|
||||
|
||||
from cgtsclient import exc
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import shortcuts
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
@ -28,6 +26,17 @@ from starlingx_dashboard.api import sysinv
|
|||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def flatten(iterable):
|
||||
result = []
|
||||
for elem in iterable:
|
||||
if isinstance(iterable, collections.Iterable) \
|
||||
and not isinstance(elem, str):
|
||||
result.extend(flatten(elem))
|
||||
else:
|
||||
result.append(elem)
|
||||
return result
|
||||
|
||||
|
||||
def _get_ipv4_pool_choices(pools):
|
||||
choices = []
|
||||
for p in pools:
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django import shortcuts
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
import netaddr
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
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
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
|
||||
from horizon import forms
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.template import defaultfilters as filters
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
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 exceptions
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
import logging
|
||||
|
||||
from cgtsclient import exc
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import shortcuts
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
import logging
|
||||
|
||||
from cgtsclient import exc
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import shortcuts
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import template
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import tables
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import template
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import tables
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -10,8 +10,8 @@ import logging
|
|||
|
||||
from cgtsclient import exc
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import shortcuts
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import template
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import string_concat # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
import logging
|
||||
|
||||
from cgtsclient import exc
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import shortcuts
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.core import validators # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.template import defaultfilters as filters
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon import tables
|
||||
|
|
|
@ -11,3 +11,5 @@ from starlingx_dashboard.dashboards.admin.inventory.storages.lvg_params \
|
|||
urlpatterns = [
|
||||
url(r'^(?P<key>[^/]+)/edit/$', views.EditView.as_view(),
|
||||
name='edit')]
|
||||
|
||||
app_name = "edit"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
import logging
|
||||
import re
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import template
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import string_concat # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -13,3 +13,5 @@ urlpatterns = [
|
|||
url(r'lvg/',
|
||||
include(lvg_params_urls, namespace='lvg'))
|
||||
]
|
||||
|
||||
app_name = "lvg"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
import cgcs_patch.constants as patch_constants
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import shortcuts
|
||||
from django import template
|
||||
from django.template.defaultfilters import safe # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
import logging
|
||||
|
||||
import cpu_functions.utils as icpu_utils
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from .cpu_functions import utils as icpu_utils
|
||||
from django.urls import reverse
|
||||
from django.urls import reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
import cpu_functions.utils as icpu_utils
|
||||
from .cpu_functions import utils as icpu_utils
|
||||
import sysinv.common.constants as sysinv_const
|
||||
|
||||
from cgtsclient.common import constants
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
import datetime
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import shortcuts
|
||||
from django.template.defaultfilters import title # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
import datetime
|
||||
import logging
|
||||
|
||||
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 exceptions
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django import shortcuts
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import forms
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
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
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -10,7 +10,7 @@ from collections import OrderedDict
|
|||
|
||||
from cgtsclient import exc
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import logging
|
||||
|
||||
from cgtsclient import exc
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.urls import reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -8,7 +8,7 @@ import logging
|
|||
|
||||
from dcmanagerclient import exceptions as exc
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import shortcuts
|
||||
from django.template.defaultfilters import safe
|
||||
from django.urls import reverse # noqa
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.urls import reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
|
|
Loading…
Reference in New Issue