0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 09:33:54 +01:00

Moved app_name URLconf setting into included urls modules

This commit is contained in:
Karl Hobley 2017-10-26 16:10:06 +01:00 committed by Matt Westcott
parent be6284c0a0
commit 7a3707eca0
25 changed files with 25 additions and 12 deletions

View File

@ -72,7 +72,7 @@ class WagtailAPIRouter(object):
for name, class_ in self._endpoints.items():
pattern = url(
r'^{}/'.format(name),
include(class_.get_urlpatterns(), namespace=name)
include((class_.get_urlpatterns(), name), namespace=name)
)
urlpatterns.append(pattern)

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from . import views
app_name = 'wagtailsettings'
urlpatterns = [
url(r'^(\w+)/(\w+)/$', views.edit_current_site, name='edit'),
url(r'^(\w+)/(\w+)/(\d+)/$', views.edit, name='edit'),

View File

@ -10,5 +10,5 @@ from . import urls
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^settings/', include(urls, app_name='wagtailsettings', namespace='wagtailsettings')),
url(r'^settings/', include(urls, namespace='wagtailsettings')),
]

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.contrib.wagtailsearchpromotions import views
app_name = 'wagtailsearchpromotions'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^add/$', views.add, name='add'),

View File

@ -13,7 +13,7 @@ from wagtail.wagtailcore import hooks
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^searchpicks/', include(admin_urls, app_name='wagtailsearchpromotions', namespace='wagtailsearchpromotions')),
url(r'^searchpicks/', include(admin_urls, namespace='wagtailsearchpromotions')),
]

View File

@ -29,7 +29,7 @@ urlpatterns = [
url(r'^pages/$', pages.index, name='wagtailadmin_explore_root'),
url(r'^pages/(\d+)/$', pages.index, name='wagtailadmin_explore'),
url(r'^pages/', include(wagtailadmin_pages_urls, app_name='wagtailadmin_pages', namespace='wagtailadmin_pages')),
url(r'^pages/', include(wagtailadmin_pages_urls, namespace='wagtailadmin_pages')),
# TODO: Move into wagtailadmin_pages namespace
url(r'^choose-page/$', chooser.browse, name='wagtailadmin_choose_page'),

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailadmin.views import collection_privacy, collections
app_name = 'wagtailadmin_collections'
urlpatterns = [
url(r'^$', collections.Index.as_view(), name='index'),
url(r'^add/$', collections.Create.as_view(), name='add'),

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailadmin.views import page_privacy, pages
app_name = 'wagtailadmin_pages'
urlpatterns = [
url(r'^add/(\w+)/(\w+)/(\d+)/$', pages.create, name='add'),
url(r'^add/(\w+)/(\w+)/(\d+)/preview/$', pages.PreviewOnCreate.as_view(), name='preview_on_add'),

View File

@ -25,7 +25,7 @@ class ViewSetRegistry(object):
if vs_urlpatterns:
urlpatterns.append(url(
r'^{}/'.format(viewset.url_prefix),
include(vs_urlpatterns, namespace=viewset.name)
include((vs_urlpatterns, viewset.name), namespace=viewset.name)
))
return urlpatterns

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtaildocs.views import chooser, documents, multiple
app_name = 'wagtaildocs'
urlpatterns = [
url(r'^$', documents.index, name='index'),
url(r'^add/$', documents.add, name='add'),

View File

@ -27,7 +27,7 @@ from wagtail.wagtaildocs.rich_text import DocumentLinkHandler
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^documents/', include(admin_urls, app_name='wagtaildocs', namespace='wagtaildocs')),
url(r'^documents/', include(admin_urls, namespace='wagtaildocs')),
]

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailembeds.views import chooser
app_name = 'wagtailembeds'
urlpatterns = [
url(r'^chooser/$', chooser.chooser, name='chooser'),
url(r'^chooser/upload/$', chooser.chooser_upload, name='chooser_upload'),

View File

@ -13,7 +13,7 @@ from wagtail.wagtailembeds.rich_text import MediaEmbedHandler
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^embeds/', include(urls, app_name='wagtailembeds', namespace='wagtailembeds')),
url(r'^embeds/', include(urls, namespace='wagtailembeds')),
]

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailforms import views
app_name = 'wagtailforms'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^submissions/(\d+)/$', views.list_submissions, name='list_submissions'),

View File

@ -13,7 +13,7 @@ from wagtail.wagtailforms.models import get_forms_for_user
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^forms/', include(urls, app_name='wagtailforms', namespace='wagtailforms')),
url(r'^forms/', include(urls, namespace='wagtailforms')),
]

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailimages.views import chooser, images, multiple
app_name = 'wagtailimages'
urlpatterns = [
url(r'^$', images.index, name='index'),
url(r'^(\d+)/$', images.edit, name='edit'),

View File

@ -22,7 +22,7 @@ from wagtail.wagtailimages.rich_text import ImageEmbedHandler
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^images/', include(admin_urls, namespace='wagtailimages', app_name='wagtailimages')),
url(r'^images/', include(admin_urls, namespace='wagtailimages')),
]

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailredirects import views
app_name = 'wagtailredirects'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^add/$', views.add, name='add'),

View File

@ -14,7 +14,7 @@ from wagtail.wagtailredirects.permissions import permission_policy
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^redirects/', include(urls, app_name='wagtailredirects', namespace='wagtailredirects')),
url(r'^redirects/', include(urls, namespace='wagtailredirects')),
]

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailsearch.views import queries
app_name = 'wagtailsearch_admin'
urlpatterns = [
url(r"^queries/chooser/$", queries.chooser, name="queries_chooser"),
url(r"^queries/chooser/results/$", queries.chooserresults, name="queries_chooserresults"),

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailsearch.views import search
app_name = 'wagtailsearch_frontend'
urlpatterns = [
url(r'^$', search, name='wagtailsearch_search'),
url(r'^suggest/$', search, {'use_json': True}, name='wagtailsearch_suggest'),

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailsnippets.views import chooser, snippets
app_name = 'wagtailsnippets'
urlpatterns = [
url(r'^$', snippets.index, name='index'),

View File

@ -18,7 +18,7 @@ from wagtail.wagtailsnippets.permissions import user_can_edit_snippets
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^snippets/', include(urls, app_name='wagtailsnippets', namespace='wagtailsnippets')),
url(r'^snippets/', include(urls, namespace='wagtailsnippets')),
]

View File

@ -4,6 +4,7 @@ from django.conf.urls import url
from wagtail.wagtailusers.views import users
app_name = 'wagtailusers_users'
urlpatterns = [
url(r'^$', users.index, name='index'),
url(r'^add/$', users.create, name='add'),

View File

@ -19,7 +19,7 @@ from wagtail.wagtailusers.widgets import UserListingButton
@hooks.register('register_admin_urls')
def register_admin_urls():
return [
url(r'^users/', include(users, app_name='wagtailusers_users', namespace='wagtailusers_users')),
url(r'^users/', include(users, namespace='wagtailusers_users')),
]