From 66f25af53a6e1815178b8a010ffd451822ffdc6e Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 20 Aug 2014 11:09:41 +0100 Subject: [PATCH] Latest sponsor update --- api-guide/generic-views.html | 9 +- img/1-kuwaitnet.png | Bin 0 -> 12302 bytes img/labels-and-milestones.png | Bin 0 -> 84026 bytes img/sponsors/1-kuwaitnet.png | Bin 15489 -> 3674 bytes img/sponsors/2-pulsecode.png | Bin 0 -> 2368 bytes img/sponsors/2-singing-horse.png | Bin 0 -> 20831 bytes topics/2.4-accouncement.html | 336 +++++++++++++++++++++++++++ topics/browsable-api.html | 1 + topics/kickstarter-announcement.html | 4 +- tutorial/quickstart.html | 7 +- 10 files changed, 353 insertions(+), 4 deletions(-) create mode 100644 img/1-kuwaitnet.png create mode 100644 img/labels-and-milestones.png create mode 100644 img/sponsors/2-pulsecode.png create mode 100644 img/sponsors/2-singing-horse.png create mode 100644 topics/2.4-accouncement.html diff --git a/api-guide/generic-views.html b/api-guide/generic-views.html index 3bf85b3b2..a9f96812c 100644 --- a/api-guide/generic-views.html +++ b/api-guide/generic-views.html @@ -255,6 +255,12 @@ class UserList(generics.ListCreateAPIView): if self.request.accepted_renderer.format == 'html': return 20 return 100 + + def list(self, request): + # Note the use of `get_queryset()` instead of `self.queryset` + queryset = self.get_queryset() + serializer = UserSerializer(queryset, many=True) + return Response(serializer.data)

For very simple cases you might want to pass through any class attributes using the .as_view() method. For example, your URLconf might include something the following entry.

url(r'^/users/', ListCreateAPIView.as_view(model=User), name='user-list')
@@ -268,7 +274,7 @@ class UserList(generics.ListCreateAPIView):
 

Basic settings:

The following attributes control the basic view behavior.