mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
In urlconfs, include() may now be used on an iterable of patterns instead of just a module string. Refs #6470 -- making the admin use a urlconf is much easier with this work done. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
299e1e814f
commit
c01098e9cb
3 changed files with 21 additions and 4 deletions
|
@ -81,6 +81,7 @@ test_data = (
|
|||
('kwargs_view', '/arg_view/10/', [], {'arg1':10}),
|
||||
('regressiontests.urlpatterns_reverse.views.absolute_kwargs_view', '/absolute_arg_view/', [], {}),
|
||||
('regressiontests.urlpatterns_reverse.views.absolute_kwargs_view', '/absolute_arg_view/10/', [], {'arg1':10}),
|
||||
('non_path_include', '/includes/non_path_include/', [], {})
|
||||
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
from django.conf.urls.defaults import *
|
||||
from views import empty_view, absolute_kwargs_view
|
||||
|
||||
other_patterns = patterns('',
|
||||
url(r'non_path_include/$', empty_view, name='non_path_include'),
|
||||
)
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^places/(\d+)/$', empty_view, name='places'),
|
||||
url(r'^places?/$', empty_view, name="places?"),
|
||||
|
@ -51,5 +55,9 @@ urlpatterns = patterns('',
|
|||
url(r'arg_view/(?P<arg1>\d+)/$', 'kwargs_view'),
|
||||
url(r'absolute_arg_view/(?P<arg1>\d+)/$', absolute_kwargs_view),
|
||||
url(r'absolute_arg_view/$', absolute_kwargs_view),
|
||||
|
||||
url('^includes/', include(other_patterns)),
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue