aboutsummaryrefslogtreecommitdiffstats
path: root/docs/tutorial/5-relationships-and-hyperlinked-apis.md
diff options
context:
space:
mode:
authorRichard Wackerbarth2013-01-13 10:49:49 -0600
committerRichard Wackerbarth2013-01-13 12:09:49 -0600
commit08943c3e0aad30b2f9f6b8146daa80117b7adfb3 (patch)
tree3ce17d86c89ca557a9c922e946a9d00755f5541d /docs/tutorial/5-relationships-and-hyperlinked-apis.md
parent9d47c32f444c7c1563d1686f8f397a97116d1f5e (diff)
downloaddjango-rest-framework-08943c3e0aad30b2f9f6b8146daa80117b7adfb3.tar.bz2
Format extensions have already been introduced.
If format extensions are used, they must be used in the creation of the reverse URLs.
Diffstat (limited to 'docs/tutorial/5-relationships-and-hyperlinked-apis.md')
-rw-r--r--docs/tutorial/5-relationships-and-hyperlinked-apis.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md
index c4c03495..27898f7b 100644
--- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md
+++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md
@@ -15,8 +15,8 @@ Right now we have endpoints for 'snippets' and 'users', but we don't have a sing
@api_view(('GET',))
def api_root(request, format=None):
return Response({
- 'users': reverse('user-list', request=request),
- 'snippets': reverse('snippet-list', request=request)
+ 'users': reverse('user-list', request=request, format=format),
+ 'snippets': reverse('snippet-list', request=request, format=format)
})
Notice that we're using REST framework's `reverse` function in order to return fully-qualified URLs.