1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #33476 -- Reformatted code with Black.

This commit is contained in:
django-bot
2022-02-03 20:24:19 +01:00
committed by Mariusz Felisiak
parent f68fa8b45d
commit 9c19aff7c7
1992 changed files with 139577 additions and 96284 deletions

View File

@@ -1,6 +1,6 @@
urlpatterns = []
handler400 = 'django.views.bad_handler'
handler403 = 'django.invalid_module.bad_handler'
handler404 = 'invalid_module.bad_handler'
handler500 = 'django'
handler400 = "django.views.bad_handler"
handler403 = "django.invalid_module.bad_handler"
handler404 = "invalid_module.bad_handler"
handler500 = "django"

View File

@@ -1,9 +1,9 @@
urlpatterns = []
handler400 = __name__ + '.bad_handler'
handler403 = __name__ + '.bad_handler'
handler404 = __name__ + '.bad_handler'
handler500 = __name__ + '.bad_handler'
handler400 = __name__ + ".bad_handler"
handler403 = __name__ + ".bad_handler"
handler404 = __name__ + ".bad_handler"
handler500 = __name__ + ".bad_handler"
def bad_handler():

View File

@@ -1,6 +1,6 @@
from django.urls import path, re_path
urlpatterns = [
path('/path-starting-with-slash/', lambda x: x),
re_path(r'/url-starting-with-slash/$', lambda x: x),
path("/path-starting-with-slash/", lambda x: x),
re_path(r"/url-starting-with-slash/$", lambda x: x),
]

View File

@@ -13,7 +13,7 @@ class EmptyCallableView:
urlpatterns = [
path('missing_as_view', EmptyCBV),
path('has_as_view', EmptyCBV.as_view()),
path('callable_class', EmptyCallableView()),
path("missing_as_view", EmptyCBV),
path("has_as_view", EmptyCBV.as_view()),
path("callable_class", EmptyCallableView()),
]

View File

@@ -1,3 +1,3 @@
urlpatterns = [
(r'^tuple/$', lambda x: x),
(r"^tuple/$", lambda x: x),
]

View File

@@ -1,10 +1,10 @@
urlpatterns = []
handler400 = __name__ + '.good_handler'
handler403 = __name__ + '.good_handler'
handler404 = __name__ + '.good_handler'
handler500 = __name__ + '.good_handler'
handler400 = __name__ + ".good_handler"
handler403 = __name__ + ".good_handler"
handler404 = __name__ + ".good_handler"
handler500 = __name__ + ".good_handler"
def good_handler(request, exception=None, foo='bar'):
def good_handler(request, exception=None, foo="bar"):
pass

View File

@@ -1,5 +1,5 @@
from django.urls import include, path
urlpatterns = [
path('', include([(r'^tuple/$', lambda x: x)])),
path("", include([(r"^tuple/$", lambda x: x)])),
]

View File

@@ -1,5 +1,5 @@
from django.urls import include, re_path
urlpatterns = [
re_path('^include-with-dollar$', include([])),
re_path("^include-with-dollar$", include([])),
]

View File

@@ -1,5 +1,5 @@
from django.urls import re_path
urlpatterns = [
re_path('^$', lambda x: x, name='name_with:colon'),
re_path("^$", lambda x: x, name="name_with:colon"),
]

View File

@@ -1,9 +1,14 @@
from django.urls import include, path, re_path
urlpatterns = [
path('foo/', lambda x: x, name='foo'),
path("foo/", lambda x: x, name="foo"),
# This dollar is ok as it is escaped
re_path(r'^\$', include([
path('bar/', lambda x: x, name='bar'),
])),
re_path(
r"^\$",
include(
[
path("bar/", lambda x: x, name="bar"),
]
),
),
]

View File

@@ -3,5 +3,5 @@ from django.urls import path
from django.utils.translation import gettext_lazy as _
urlpatterns = i18n_patterns(
path(_('translated/'), lambda x: x, name='i18n_prefixed'),
path(_("translated/"), lambda x: x, name="i18n_prefixed"),
)

View File

@@ -1,13 +1,16 @@
from django.urls import include, path
common_url_patterns = ([
path('app-ns1/', include([])),
path('app-url/', include([])),
], 'app-ns1')
common_url_patterns = (
[
path("app-ns1/", include([])),
path("app-url/", include([])),
],
"app-ns1",
)
urlpatterns = [
path('app-ns1-0/', include(common_url_patterns)),
path('app-ns1-1/', include(common_url_patterns)),
path('app-some-url/', include(([], 'app'), namespace='app-1')),
path('app-some-url-2/', include(([], 'app'), namespace='app-1'))
path("app-ns1-0/", include(common_url_patterns)),
path("app-ns1-1/", include(common_url_patterns)),
path("app-some-url/", include(([], "app"), namespace="app-1")),
path("app-some-url-2/", include(([], "app"), namespace="app-1")),
]

View File

@@ -1,5 +1,5 @@
from django.urls import path
urlpatterns = [
path('^beginning-with-caret', lambda x: x),
path("^beginning-with-caret", lambda x: x),
]

View File

@@ -1,5 +1,5 @@
from django.urls import path
urlpatterns = [
path(r'(?P<named_group>\d+)', lambda x: x),
path(r"(?P<named_group>\d+)", lambda x: x),
]

View File

@@ -1,5 +1,5 @@
from django.urls import path
urlpatterns = [
path('ending-with-dollar$', lambda x: x),
path("ending-with-dollar$", lambda x: x),
]

View File

@@ -1,20 +1,26 @@
from django.urls import include, path
common_url_patterns = ([
path('app-ns1/', include([])),
path('app-url/', include([])),
], 'common')
common_url_patterns = (
[
path("app-ns1/", include([])),
path("app-url/", include([])),
],
"common",
)
nested_url_patterns = ([
path('common/', include(common_url_patterns, namespace='nested')),
], 'nested')
nested_url_patterns = (
[
path("common/", include(common_url_patterns, namespace="nested")),
],
"nested",
)
urlpatterns = [
path('app-ns1-0/', include(common_url_patterns, namespace='app-include-1')),
path('app-ns1-1/', include(common_url_patterns, namespace='app-include-2')),
path("app-ns1-0/", include(common_url_patterns, namespace="app-include-1")),
path("app-ns1-1/", include(common_url_patterns, namespace="app-include-2")),
# 'nested' is included twice but namespaced by nested-1 and nested-2.
path('app-ns1-2/', include(nested_url_patterns, namespace='nested-1')),
path('app-ns1-3/', include(nested_url_patterns, namespace='nested-2')),
path("app-ns1-2/", include(nested_url_patterns, namespace="nested-1")),
path("app-ns1-3/", include(nested_url_patterns, namespace="nested-2")),
# namespaced URLs inside non-namespaced URLs.
path('app-ns1-4/', include([path('abc/', include(common_url_patterns))])),
path("app-ns1-4/", include([path("abc/", include(common_url_patterns))])),
]

View File

@@ -1,7 +1,12 @@
from django.urls import include, path, re_path
urlpatterns = [
path('', include([
re_path('^include-with-dollar$', include([])),
])),
path(
"",
include(
[
re_path("^include-with-dollar$", include([])),
]
),
),
]