Skip to content

Generic views

Concrete async generic views built on top of AsyncGenericAPIView. See the Generic views guide for the hooks, filter backends, and pagination flow.

AsyncGenericAPIView

Bases: AsyncAPIView, GenericAPIView

Base class for all other generic views, with an async dispatch loop.

Adds aget_object, afilter_queryset, and apaginate_queryset, falling back to sync_to_async for sync filter backends and paginators that do not expose async hooks.

afilter_queryset async

afilter_queryset(queryset)

Returns a filtered queryset, awaiting any async-aware filter backends.

apaginate_queryset async

apaginate_queryset(queryset)

Returns a single page of results, or None if pagination is disabled.

aget_object async

aget_object()

Returns the object the view is displaying, looked up via queryset.aget.

AsyncListAPIView

Bases: AsyncListModelMixin, AsyncGenericAPIView

Concrete view for listing a queryset, served via the async pipeline.

AsyncCreateAPIView

Bases: AsyncCreateModelMixin, AsyncGenericAPIView

Concrete view for creating a model instance, served via the async pipeline.

AsyncRetrieveAPIView

Bases: AsyncRetrieveModelMixin, AsyncGenericAPIView

Concrete view for retrieving a model instance, served via the async pipeline.

AsyncUpdateAPIView

Bases: AsyncUpdateModelMixin, AsyncGenericAPIView

Concrete view for updating a model instance, served via the async pipeline.

AsyncDestroyAPIView

Bases: AsyncDestroyModelMixin, AsyncGenericAPIView

Concrete view for deleting a model instance, served via the async pipeline.

AsyncListCreateAPIView

Bases: AsyncListModelMixin, AsyncCreateModelMixin, AsyncGenericAPIView

Concrete view for listing a queryset or creating a model instance, served via the async pipeline.

AsyncRetrieveUpdateAPIView

Bases: AsyncRetrieveModelMixin, AsyncUpdateModelMixin, AsyncGenericAPIView

Concrete view for retrieving or updating a model instance, served via the async pipeline.

AsyncRetrieveDestroyAPIView

Bases: AsyncRetrieveModelMixin, AsyncDestroyModelMixin, AsyncGenericAPIView

Concrete view for retrieving or deleting a model instance, served via the async pipeline.

AsyncRetrieveUpdateDestroyAPIView

Bases: AsyncRetrieveModelMixin, AsyncUpdateModelMixin, AsyncDestroyModelMixin, AsyncGenericAPIView

Concrete view for retrieving, updating, or deleting a model instance, served via the async pipeline.