Browse Source

Address RemovedInDjango40Warning

In Django 3.1, django.conf.urls.url() is deprecated
in favor of django.urls.re_path(). For more info see [1]
These were already replaced in Horizon repo by [2].

[1] https://docs.djangoproject.com/en/4.0/releases/3.1/#id2
[2] https://review.opendev.org/c/openstack/horizon/+/827093

Change-Id: I71e21300e6c072f790ae0517bb40d18b01a4a23b
changes/70/839970/1
manchandavishal 4 months ago
parent
commit
837eb58428
  1. 13
      blazar_dashboard/content/hosts/urls.py
  2. 25
      blazar_dashboard/content/leases/urls.py

13
blazar_dashboard/content/hosts/urls.py

@ -10,15 +10,16 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls import url
from django.urls import re_path
from blazar_dashboard.content.hosts import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^create/$', views.CreateView.as_view(), name='create'),
url(r'^(?P<host_id>[^/]+)/$', views.DetailView.as_view(), name='detail'),
url(r'^(?P<host_id>[^/]+)/update$', views.UpdateView.as_view(),
name='update'),
re_path(r'^$', views.IndexView.as_view(), name='index'),
re_path(r'^create/$', views.CreateView.as_view(), name='create'),
re_path(r'^(?P<host_id>[^/]+)/$', views.DetailView.as_view(),
name='detail'),
re_path(r'^(?P<host_id>[^/]+)/update$', views.UpdateView.as_view(),
name='update'),
]

25
blazar_dashboard/content/leases/urls.py

@ -13,21 +13,22 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls import url
from django.urls import re_path
from blazar_dashboard.content.leases import views as leases_views
urlpatterns = [
url(r'^calendar/(?P<resource_type>[^/]+)/$',
leases_views.CalendarView.as_view(), name='calendar'),
url(r'^calendar/(?P<resource_type>[^/]+)/resources\.json$',
leases_views.calendar_data_view,
name='calendar_data'),
url(r'^$', leases_views.IndexView.as_view(), name='index'),
url(r'^create/$', leases_views.CreateView.as_view(), name='create'),
url(r'^(?P<lease_id>[^/]+)/$', leases_views.DetailView.as_view(),
name='detail'),
url(r'^(?P<lease_id>[^/]+)/update$', leases_views.UpdateView.as_view(),
name='update'),
re_path(r'^calendar/(?P<resource_type>[^/]+)/$',
leases_views.CalendarView.as_view(), name='calendar'),
re_path(r'^calendar/(?P<resource_type>[^/]+)/resources\.json$',
leases_views.calendar_data_view,
name='calendar_data'),
re_path(r'^$', leases_views.IndexView.as_view(), name='index'),
re_path(r'^create/$', leases_views.CreateView.as_view(), name='create'),
re_path(r'^(?P<lease_id>[^/]+)/$', leases_views.DetailView.as_view(),
name='detail'),
re_path(r'^(?P<lease_id>[^/]+)/update$',
leases_views.UpdateView.as_view(),
name='update'),
]

Loading…
Cancel
Save