diff --git a/api-guide/generic-views.html b/api-guide/generic-views.html index c6d6194c3..40eb204ec 100644 --- a/api-guide/generic-views.html +++ b/api-guide/generic-views.html @@ -115,6 +115,7 @@
  • ListAPIView
  • ListCreateAPIView
  • RetrieveAPIView
  • +
  • RetrieveDestroyAPIView
  • RetrieveUpdateDestroyAPIView
  • Base views
  • BaseAPIView
  • @@ -170,20 +171,25 @@

    API Reference

    +

    The following classes are the concrete generic views. If you're using generic views this is normally the level you'll be working at unless you need heavily customized behavior.

    ListAPIView

    -

    Used for read-only endpoints to represent a collection of model instances.

    +

    Used for read-only endpoints to represent a collection of model instances.

    Provides a get method handler.

    Extends: MultipleObjectBaseAPIView, ListModelMixin

    ListCreateAPIView

    -

    Used for read-write endpoints to represent a collection of model instances.

    +

    Used for read-write endpoints to represent a collection of model instances.

    Provides get and post method handlers.

    Extends: MultipleObjectBaseAPIView, ListModelMixin, CreateModelMixin

    RetrieveAPIView

    -

    Used for read-only endpoints to represent a single model instance.

    +

    Used for read-only endpoints to represent a single model instance.

    Provides a get method handler.

    Extends: SingleObjectBaseAPIView, RetrieveModelMixin

    +

    RetrieveDestroyAPIView

    +

    Used for read or delete endpoints to represent a single model instance.

    +

    Provides get and delete method handlers.

    +

    Extends: SingleObjectBaseAPIView, RetrieveModelMixin, DestroyModelMixin

    RetrieveUpdateDestroyAPIView

    -

    Used for read-write endpoints to represent a single model instance.

    +

    Used for read-write endpoints to represent a single model instance.

    Provides get, put and delete method handlers.

    Extends: SingleObjectBaseAPIView, RetrieveModelMixin, UpdateModelMixin, DestroyModelMixin


    @@ -202,14 +208,19 @@

    The mixin classes provide the actions that are used to provide the basic view behaviour. Note that the mixin classes provide action methods rather than defining the handler methods such as .get() and .post() directly. This allows for more flexible composition of behaviour.

    ListModelMixin

    Provides a .list(request, *args, **kwargs) method, that implements listing a queryset.

    +

    Should be mixed in with MultipleObjectBaseAPIView.

    CreateModelMixin

    Provides a .create(request, *args, **kwargs) method, that implements creating and saving a new model instance.

    +

    Should be mixed in with any BaseAPIView.

    RetrieveModelMixin

    Provides a .retrieve(request, *args, **kwargs) method, that implements returning an existing model instance in a response.

    +

    Should be mixed in with SingleObjectBaseAPIView.

    UpdateModelMixin

    Provides a .update(request, *args, **kwargs) method, that implements updating and saving an existing model instance.

    +

    Should be mixed in with SingleObjectBaseAPIView.

    DestroyModelMixin

    Provides a .destroy(request, *args, **kwargs) method, that implements deletion of an existing model instance.

    +

    Should be mixed in with SingleObjectBaseAPIView.