From 35331f5820cff9a5cd97ccff2c1cbbb8a5a62790 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 26 Feb 2013 19:54:04 +0000 Subject: [PATCH] More consistent examples --- docs/api-guide/format-suffixes.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/api-guide/format-suffixes.md b/docs/api-guide/format-suffixes.md index 53e5f2bf4..d63efc9c9 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[0-9]+)/$', 'comment_instance') + url(r'^comment/$', 'comment_list'), + url(r'^comment/(?P[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...