Skip to content

Commit

Permalink
Merge pull request #1 from boilerroomtv/update_for_django_4
Browse files Browse the repository at this point in the history
feat: update to django 4
  • Loading branch information
Winspear authored Oct 12, 2022
2 parents d052402 + b99a636 commit 83ec989
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
12 changes: 6 additions & 6 deletions docs/dashboard_custom_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ in ``dashboard_modules_views.py`` file inside your application:

.. code-block:: python
from django.conf.urls import url
from django.conf.urls import re_path
from django.contrib import messages
from django.shortcuts import redirect
from jet.dashboard import dashboard
Expand All @@ -157,7 +157,7 @@ in ``dashboard_modules_views.py`` file inside your application:
# This method registers view's url
dashboard.urls.register_urls([
url(
re_path(
r'^update_database/',
update_database,
name='update-database'
Expand All @@ -169,16 +169,16 @@ You should import this file before dashboard urls have been imported in you main
.. code-block:: python
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls import include, re_path
from django.contrib import admin
# Import dashboard module views
from core import dashboard_modules_views
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^jet/', include('jet.urls', 'jet')),
url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
re_path(r'^admin/', include(admin.site.urls)),
re_path(r'^jet/', include('jet.urls', 'jet')),
re_path(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
...
]
Expand Down
8 changes: 4 additions & 4 deletions jet/dashboard/dashboard_modules/google_analytics_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
except ImportError: # Django 1.11
from django.urls import reverse

from django.conf.urls import url
from django.conf.urls import re_path
from django.contrib import messages
from django.shortcuts import redirect
from httplib2 import ServerNotFoundError
Expand Down Expand Up @@ -52,7 +52,7 @@ def google_analytics_callback_view(request):
return redirect(reverse('jet-dashboard:update_module', kwargs={'pk': module.pk}))

dashboard.urls.register_urls([
url(r'^google-analytics/grant/(?P<pk>\d+)/$', google_analytics_grant_view, name='google-analytics-grant'),
url(r'^google-analytics/revoke/(?P<pk>\d+)/$', google_analytics_revoke_view, name='google-analytics-revoke'),
url(r'^google-analytics/callback/', google_analytics_callback_view, name='google-analytics-callback'),
re_path(r'^google-analytics/grant/(?P<pk>\d+)/$', google_analytics_grant_view, name='google-analytics-grant'),
re_path(r'^google-analytics/revoke/(?P<pk>\d+)/$', google_analytics_revoke_view, name='google-analytics-revoke'),
re_path(r'^google-analytics/callback/', google_analytics_callback_view, name='google-analytics-callback'),
])
8 changes: 4 additions & 4 deletions jet/dashboard/dashboard_modules/yandex_metrika_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.conf.urls import url
from django.conf.urls import re_path
from django.contrib import messages
try:
from django.core.urlresolvers import reverse
Expand Down Expand Up @@ -50,17 +50,17 @@ def yandex_metrika_callback_view(request):


dashboard.urls.register_urls([
url(
re_path(
r'^yandex-metrika/grant/(?P<pk>\d+)/$',
yandex_metrika_grant_view,
name='yandex-metrika-grant'
),
url(
re_path(
r'^yandex-metrika/revoke/(?P<pk>\d+)/$',
yandex_metrika_revoke_view,
name='yandex-metrika-revoke'
),
url(
re_path(
r'^yandex-metrika/callback/$',
yandex_metrika_callback_view,
name='yandex-metrika-callback'
Expand Down
18 changes: 9 additions & 9 deletions jet/dashboard/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import django
from django.conf.urls import url
from django.conf.urls import re_path

try:
from django.views.i18n import JavaScriptCatalog
Expand All @@ -15,42 +15,42 @@
app_name = 'dashboard'

urlpatterns = [
url(
re_path(
r'^module/(?P<pk>\d+)/$',
UpdateDashboardModuleView.as_view(),
name='update_module'
),
url(
re_path(
r'^update_dashboard_modules/$',
update_dashboard_modules_view,
name='update_dashboard_modules'
),
url(
re_path(
r'^add_user_dashboard_module/$',
add_user_dashboard_module_view,
name='add_user_dashboard_module'
),
url(
re_path(
r'^update_dashboard_module_collapse/$',
update_dashboard_module_collapse_view,
name='update_dashboard_module_collapse'
),
url(
re_path(
r'^remove_dashboard_module/$',
remove_dashboard_module_view,
name='remove_dashboard_module'
),
url(
re_path(
r'^load_dashboard_module/(?P<pk>\d+)/$',
load_dashboard_module_view,
name='load_dashboard_module'
),
url(
re_path(
r'^reset_dashboard/$',
reset_dashboard_view,
name='reset_dashboard'
),
url(
re_path(
r'^jsi18n/$',
javascript_catalog,
{'packages': 'jet'},
Expand Down
12 changes: 6 additions & 6 deletions jet/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import django
from django.conf.urls import url
from django.conf.urls import re_path

try:
from django.views.i18n import JavaScriptCatalog
Expand All @@ -13,27 +13,27 @@
app_name = 'jet'

urlpatterns = [
url(
re_path(
r'^add_bookmark/$',
add_bookmark_view,
name='add_bookmark'
),
url(
re_path(
r'^remove_bookmark/$',
remove_bookmark_view,
name='remove_bookmark'
),
url(
re_path(
r'^toggle_application_pin/$',
toggle_application_pin_view,
name='toggle_application_pin'
),
url(
re_path(
r'^model_lookup/$',
model_lookup_view,
name='model_lookup'
),
url(
re_path(
r'^jsi18n/$',
javascript_catalog,
{'packages': 'django.contrib.admin+jet'},
Expand Down

0 comments on commit 83ec989

Please sign in to comment.