aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/urlpatterns.py
diff options
context:
space:
mode:
authorTom Christie2012-11-09 13:49:52 +0000
committerTom Christie2012-11-09 13:49:52 +0000
commit8953a60196cb55ec75902882314da5a42636349c (patch)
tree43bf6ea1f69955aeecd83fb9f866d92ea9a5f3df /rest_framework/urlpatterns.py
parentb78872b7dbb55f1aa2d21f15fbb952f0c7156326 (diff)
parent9aaeeacdfebc244850e82469e4af45af252cca4d (diff)
downloaddjango-rest-framework-8953a60196cb55ec75902882314da5a42636349c.tar.bz2
Merge with master
Diffstat (limited to 'rest_framework/urlpatterns.py')
-rw-r--r--rest_framework/urlpatterns.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/rest_framework/urlpatterns.py b/rest_framework/urlpatterns.py
index 386c78a2..316ccd19 100644
--- a/rest_framework/urlpatterns.py
+++ b/rest_framework/urlpatterns.py
@@ -2,26 +2,23 @@ from django.conf.urls.defaults import url
from rest_framework.settings import api_settings
-def format_suffix_patterns(urlpatterns, suffix_required=False,
- suffix_kwarg=None, allowed=None):
+def format_suffix_patterns(urlpatterns, suffix_required=False, allowed=None):
"""
Supplement existing urlpatterns with corrosponding patterns that also
include a '.format' suffix. Retains urlpattern ordering.
+ urlpatterns:
+ A list of URL patterns.
+
suffix_required:
If `True`, only suffixed URLs will be generated, and non-suffixed
URLs will not be used. Defaults to `False`.
- suffix_kwarg:
- The name of the kwarg that will be passed to the view.
- Defaults to 'format'.
-
allowed:
An optional tuple/list of allowed suffixes. eg ['json', 'api']
Defaults to `None`, which allows any suffix.
-
"""
- suffix_kwarg = suffix_kwarg or api_settings.FORMAT_SUFFIX_KWARG
+ suffix_kwarg = api_settings.FORMAT_SUFFIX_KWARG
if allowed:
if len(allowed) == 1:
allowed_pattern = allowed[0]