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.