aboutsummaryrefslogtreecommitdiffstats
path: root/docs/tutorial/5-relationships-and-hyperlinked-apis.md
diff options
context:
space:
mode:
authorTom Christie2013-04-24 22:40:24 +0100
committerTom Christie2013-04-24 22:40:24 +0100
commitb94da2468cdda6b0ad491574d35097d0e336ea7f (patch)
treebfb05f85703a738918252c8968f9a460554cae3f /docs/tutorial/5-relationships-and-hyperlinked-apis.md
parent835d3f89d37b873b2ef96dc7d71922b035b07328 (diff)
downloaddjango-rest-framework-b94da2468cdda6b0ad491574d35097d0e336ea7f.tar.bz2
Various clean up and lots of docs
Diffstat (limited to 'docs/tutorial/5-relationships-and-hyperlinked-apis.md')
-rw-r--r--docs/tutorial/5-relationships-and-hyperlinked-apis.md30
1 files changed, 6 insertions, 24 deletions
diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md
index 27a10840..c9c37547 100644
--- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md
+++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md
@@ -34,8 +34,8 @@ Instead of using a concrete generic view, we'll use the base class for represent
from rest_framework import renderers
from rest_framework.response import Response
- class SnippetHighlight(generics.SingleObjectAPIView):
- model = Snippet
+ class SnippetHighlight(generics.GenericAPIView):
+ queryset = Snippet.objects.all()
renderer_classes = (renderers.StaticHTMLRenderer,)
def get(self, request, *args, **kwargs):
@@ -143,34 +143,16 @@ We can change the default list style to use pagination, by modifying our `settin
'PAGINATE_BY': 10
}
-Note that settings in REST framework are all namespaced into a single dictionary setting, named 'REST_FRAMEWORK', which helps keep them well seperated from your other project settings.
+Note that settings in REST framework are all namespaced into a single dictionary setting, named 'REST_FRAMEWORK', which helps keep them well separated from your other project settings.
We could also customize the pagination style if we needed too, but in this case we'll just stick with the default.
-## Reviewing our work
+## Browsing the API
If we open a browser and navigate to the browseable API, you'll find that you can now work your way around the API simply by following links.
You'll also be able to see the 'highlight' links on the snippet instances, that will take you to the highlighted code HTML representations.
-We've now got a complete pastebin Web API, which is fully web browseable, and comes complete with authentication, per-object permissions, and multiple renderer formats.
+In [part 6][tut-6] of the tutorial we'll look at how we can use ViewSets and Routers to reduce the amount of code we need to build our API.
-We've walked through each step of the design process, and seen how if we need to customize anything we can gradually work our way down to simply using regular Django views.
-
-You can review the final [tutorial code][repo] on GitHub, or try out a live example in [the sandbox][sandbox].
-
-## Onwards and upwards
-
-We've reached the end of our tutorial. If you want to get more involved in the REST framework project, here's a few places you can start:
-
-* Contribute on [GitHub][github] by reviewing and submitting issues, and making pull requests.
-* Join the [REST framework discussion group][group], and help build the community.
-* Follow [the author][twitter] on Twitter and say hi.
-
-**Now go build awesome things.**
-
-[repo]: https://github.com/tomchristie/rest-framework-tutorial
-[sandbox]: http://restframework.herokuapp.com/
-[github]: https://github.com/tomchristie/django-rest-framework
-[group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework
-[twitter]: https://twitter.com/_tomchristie
+[tut-6]: 6-viewsets-and-routers.md