aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/viewsets.py
diff options
context:
space:
mode:
authorTom Christie2013-06-05 13:33:19 +0100
committerTom Christie2013-06-05 13:33:19 +0100
commitde00ec95c3007dd90b5b01f7486b430699ea63c1 (patch)
treed2ce8037d446fd9133b3d6a77ebcc49350d7ebc3 /rest_framework/viewsets.py
parent9428d6ddb5ebc2d5d9c8557a52be09f0def69cca (diff)
parent2ca243a1144bb2a5461767a21ed14dec1d2b8dc2 (diff)
downloaddjango-rest-framework-de00ec95c3007dd90b5b01f7486b430699ea63c1.tar.bz2
Merge master
Diffstat (limited to 'rest_framework/viewsets.py')
-rw-r--r--rest_framework/viewsets.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/rest_framework/viewsets.py b/rest_framework/viewsets.py
index 0eb3e86d..d91323f2 100644
--- a/rest_framework/viewsets.py
+++ b/rest_framework/viewsets.py
@@ -108,10 +108,18 @@ class ViewSet(ViewSetMixin, views.APIView):
pass
+class GenericViewSet(ViewSetMixin, generics.GenericAPIView):
+ """
+ The GenericViewSet class does not provide any actions by default,
+ but does include the base set of generic view behavior, such as
+ the `get_object` and `get_queryset` methods.
+ """
+ pass
+
+
class ReadOnlyModelViewSet(mixins.RetrieveModelMixin,
mixins.ListModelMixin,
- ViewSetMixin,
- generics.GenericAPIView):
+ GenericViewSet):
"""
A viewset that provides default `list()` and `retrieve()` actions.
"""
@@ -123,8 +131,7 @@ class ModelViewSet(mixins.CreateModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
mixins.ListModelMixin,
- ViewSetMixin,
- generics.GenericAPIView):
+ GenericViewSet):
"""
A viewset that provides default `create()`, `retrieve()`, `update()`,
`partial_update()`, `destroy()` and `list()` actions.