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

AsyncCreateAPIView

AsyncRetrieveAPIView

AsyncUpdateAPIView

AsyncDestroyAPIView

AsyncRetrieveUpdateAPIView

Bases: AsyncRetrieveModelMixin, AsyncUpdateModelMixin, AsyncGenericAPIView

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