Skip to content

Commit f94c500

Browse files
committed
Removed all references to django.conf.urls.patterns
1 parent f166e4d commit f94c500

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

Diff for: README.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ Hooking it up:
130130
.. code:: python
131131
132132
# api/urls.py
133-
from django.conf.urls.default import url, patterns, include
133+
from django.conf.urls.default import url, include
134134
135135
from posts.api import PostResource
136136
137-
urlpatterns = patterns('',
137+
urlpatterns = [
138138
# The usual suspects, then...
139139
140140
url(r'^api/posts/', include(PostResource.urls())),
141-
)
141+
]
142142
143143
144144
Licence

Diff for: docs/extending.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Finally, it's just a matter of hooking up the URLs as well. You can do this
9292
manually or (once again) by extending a built-in method.::
9393

9494
# Add the correct import here.
95-
from django.conf.urls import patterns, url
95+
from django.conf.urls import url
9696

9797
from restless.dj import DjangoResource
9898
from restless.resources import skip_prepare
@@ -128,9 +128,9 @@ manually or (once again) by extending a built-in method.::
128128
@classmethod
129129
def urls(cls, name_prefix=None):
130130
urlpatterns = super(PostResource, cls).urls(name_prefix=name_prefix)
131-
return urlpatterns + patterns('',
131+
return urlpatterns + [
132132
url(r'^schema/$', cls.as_view('schema'), name=cls.build_url_name('schema', name_prefix)),
133-
)
133+
]
134134

135135
.. note::
136136

Diff for: docs/tutorial.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,17 @@ practice would be to create a URLconf just for the API portion of your site.::
252252

253253
# The ``settings.ROOT_URLCONF`` file
254254
# myproject/urls.py
255-
from django.conf.urls import patterns, url, include
255+
from django.conf.urls import url, include
256256

257257
# Add this!
258258
from posts.api import PostResource
259259

260-
urlpatterns = patterns('',
260+
urlpatterns = [
261261
# The usual fare, then...
262262

263263
# Add this!
264264
url(r'api/posts/', include(PostResource.urls())),
265-
)
265+
]
266266

267267
Note that unlike some other CBVs (admin specifically), the ``urls`` here is a
268268
**METHOD**, not an attribute/property. Those parens are important!
@@ -272,13 +272,13 @@ Manual URLconfs
272272

273273
You can also manually hook up URLs by specifying something like::
274274

275-
urlpatterns = patterns('',
275+
urlpatterns = [
276276
# ...
277277

278278
# Identical to the above.
279279
url(r'api/posts/$', PostResource.as_list(), name='api_post_list'),
280280
url(r'api/posts/(?P<pk>\d+)/$', PostResource.as_detail(), name='api_post_detail'),
281-
)
281+
]
282282

283283

284284
Testing the API

Diff for: examples/django/posts/urls.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from django.conf.urls import patterns, url, include
1+
from django.conf.urls import url, include
22

33
from .api import PostResource
44

55

6-
urlpatterns = patterns('',
6+
urlpatterns = [
77
url(r'^posts/', include(PostResource.urls())),
88

99
# Alternatively, if you don't like the defaults...
1010
# url(r'^posts/$', PostResource.as_list(), name='api_posts_list'),
1111
# url(r'^posts/(?P<pk>\d+)/$', PostResource.as_detail(), name='api_posts_detail'),
12-
)
12+
]

Diff for: restless/dj.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import six
22

33
from django.conf import settings
4-
from django.conf.urls import patterns, url
4+
from django.conf.urls import url
55
from django.core.exceptions import ObjectDoesNotExist
66
from django.http import HttpResponse, Http404
77
from django.views.decorators.csrf import csrf_exempt

0 commit comments

Comments
 (0)