aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2013-02-26 19:54:04 +0000
committerTom Christie2013-02-26 19:54:04 +0000
commit35331f5820cff9a5cd97ccff2c1cbbb8a5a62790 (patch)
tree270e64cc566da6c63a50f8007804ca0723f37e0c
parente7ca326555b02e1f415469c83495f99c22ea1a0f (diff)
downloaddjango-rest-framework-35331f5820cff9a5cd97ccff2c1cbbb8a5a62790.tar.bz2
More consistent examples
-rw-r--r--docs/api-guide/format-suffixes.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/docs/api-guide/format-suffixes.md b/docs/api-guide/format-suffixes.md
index 53e5f2bf..d63efc9c 100644
--- a/docs/api-guide/format-suffixes.md
+++ b/docs/api-guide/format-suffixes.md
@@ -29,8 +29,8 @@ Example:
urlpatterns = patterns('blog.views',
url(r'^/$', 'api_root'),
- url(r'^comment/$', 'comment_root'),
- url(r'^comment/(?P<pk>[0-9]+)/$', 'comment_instance')
+ url(r'^comment/$', 'comment_list'),
+ url(r'^comment/(?P<pk>[0-9]+)/$', 'comment_detail')
)
urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'html'])
@@ -38,13 +38,12 @@ Example:
When using `format_suffix_patterns`, you must make sure to add the `'format'` keyword argument to the corresponding views. For example:
@api_view(('GET', 'POST'))
- def api_root(request, format=None):
+ def comment_list(request, format=None):
# do stuff...
Or with class based views:
class CommentList(APIView):
-
def get(self, request, format=None):
# do stuff...