rest_witchcraft.viewsets module¶
-
class
rest_witchcraft.viewsets.
ExpandableModelViewSet
(**kwargs)[source]¶ Bases:
rest_witchcraft.mixins.ExpandableQuerySerializerMixin
,rest_witchcraft.viewsets.ModelViewSet
A viewset that provides automatically eagerloadsany subfields that are expanded via querystring.
For queryset to be expanded, either
rest_witchcraft.serializers.ExpandableModelSerializer
needs to be used inserializer_class
orquery_serializer_class
can be manually provided.
-
class
rest_witchcraft.viewsets.
GenericViewSet
(**kwargs)[source]¶ Bases:
rest_framework.viewsets.ViewSetMixin
,rest_witchcraft.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.
-
class
rest_witchcraft.viewsets.
ModelViewSet
(**kwargs)[source]¶ Bases:
rest_framework.mixins.CreateModelMixin
,rest_framework.mixins.RetrieveModelMixin
,rest_framework.mixins.UpdateModelMixin
,rest_witchcraft.mixins.DestroyModelMixin
,rest_framework.mixins.ListModelMixin
,rest_witchcraft.viewsets.GenericViewSet
A viewset that provides default create(), retrieve(), update(), partial_update(), destroy() and list() actions.
-
class
rest_witchcraft.viewsets.
ReadOnlyViewModelViewSet
(**kwargs)[source]¶ Bases:
rest_framework.mixins.RetrieveModelMixin
,rest_framework.mixins.ListModelMixin
,rest_witchcraft.viewsets.GenericViewSet
A viewset that provides default list() and retrieve() actions.