From 480b64d3138f4b37dc1cbce7202573fb1f94f2a6 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Sat, 14 Dec 2013 20:44:09 +0000 Subject: Latest docs build --- tutorial/quickstart.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tutorial') diff --git a/tutorial/quickstart.html b/tutorial/quickstart.html index 0dfb8a45..842cacb1 100644 --- a/tutorial/quickstart.html +++ b/tutorial/quickstart.html @@ -283,6 +283,8 @@ class GroupViewSet(viewsets.ModelViewSet):

Rather than write multiple views we're grouping together all the common behavior into classes called ViewSets.

We can easily break these down into individual views if we need to, but using viewsets keeps the view logic nicely organized as well as being very concise.

+

Notice that our viewset classes here are a little different from those in the frontpage example, as they include queryset and serializer_class attributes, instead of a model attribute.

+

For trivial cases you can simply set a model attribute on the ViewSet class and the serializer and queryset will be automatically generated for you. Setting the queryset and/or serializer_class attributes gives you more explicit control of the API behaviour, and is the recommended style for most applications.

URLs

Okay, now let's wire up the API URLs. On to tutorial/urls.py...

from django.conf.urls import patterns, url, include
-- 
cgit v1.2.3