diff options
| author | Tom Christie | 2012-10-19 19:59:46 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-10-19 19:59:55 +0100 |
| commit | efabd2bb1b762fbdee2b48fa3a6ccb8f23c7e8dc (patch) | |
| tree | 7079d77c9e1bb40a229d8d6b4f871aaa8c59155d /rest_framework/urlpatterns.py | |
| parent | 46dffbd5b9fcb60885067bdf65c9d63db25f543b (diff) | |
| download | django-rest-framework-efabd2bb1b762fbdee2b48fa3a6ccb8f23c7e8dc.tar.bz2 | |
docs, docs, docs, docs, docs, docs, docs
Diffstat (limited to 'rest_framework/urlpatterns.py')
| -rw-r--r-- | rest_framework/urlpatterns.py | 13 |
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] |
