mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
Fixed #24700 -- Added dash to slug regex in http docs
This commit is contained in:
parent
8efea1b8d5
commit
269a5dbdd3
@ -320,10 +320,10 @@ prefix is used repeatedly. For example, consider this URLconf::
|
|||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/history/$', views.history),
|
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/history/$', views.history),
|
||||||
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/edit/$', views.edit),
|
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/edit/$', views.edit),
|
||||||
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/discuss/$', views.discuss),
|
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/discuss/$', views.discuss),
|
||||||
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/permissions/$', views.permissions),
|
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/permissions/$', views.permissions),
|
||||||
]
|
]
|
||||||
|
|
||||||
We can improve this by stating the common path prefix only once and grouping
|
We can improve this by stating the common path prefix only once and grouping
|
||||||
@ -333,7 +333,7 @@ the suffixes that differ::
|
|||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/', include([
|
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/', include([
|
||||||
url(r'^history/$', views.history),
|
url(r'^history/$', views.history),
|
||||||
url(r'^edit/$', views.edit),
|
url(r'^edit/$', views.edit),
|
||||||
url(r'^discuss/$', views.discuss),
|
url(r'^discuss/$', views.discuss),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user