rest_framework.mixins

Basic building blocks for generic class based views.

We don’t bind behaviour to http method handlers yet, which allows mixin classes to be composed in interesting ways.

Module Contents

class CreateModelMixin

Bases:object

Create a model instance.

create(self, request, *args, **kwargs)
perform_create(self, serializer)
get_success_headers(self, data)
class ListModelMixin

Bases:object

List a queryset.

list(self, request, *args, **kwargs)
class RetrieveModelMixin

Bases:object

Retrieve a model instance.

retrieve(self, request, *args, **kwargs)
class UpdateModelMixin

Bases:object

Update a model instance.

update(self, request, *args, **kwargs)
perform_update(self, serializer)
partial_update(self, request, *args, **kwargs)
class DestroyModelMixin

Bases:object

Destroy a model instance.

destroy(self, request, *args, **kwargs)
perform_destroy(self, instance)