Skip to content

Reference

Autodocumented public API. Every page reads the docstrings and signatures from the source — when in doubt, follow the source link ("Edit this page" in the top right) and read the leaf module.

  • ViewsServiceCreateView, ServiceUpdateView, ServiceDeleteView, SelectorListView, SelectorRetrieveView, MutationFlowMixin, ServiceView Protocol, kwarg-resolution helpers, spec validation.
  • ViewsetsServiceViewSet, SelectorViewSet, per-action mixins, ActionSerializerResolver, @service_action, @selector_action.
  • Mutationsapply_input, create_from_input, update_from_input and async siblings.
  • Services — service Protocols, the implements decorator, and the call_service / acall_service HTTP-scope helpers.
  • Selectors — selector Protocols and the call_selector / acall_selector HTTP-scope helpers.
  • TypesServiceSpec, SelectorSpec, ChangeResult, FieldChange, UNSET, UnsetType, NoInput, HttpExtras.
  • ExceptionsServiceError, ServiceValidationError.
  • OpenAPIenable_openapi, ServiceAutoSchema, ServiceErrorSerializer (opt-in drf-spectacular adapter).

Public surface

The top-level rest_framework_services package re-exports the user- facing API. Everything below is supported, but deeper imports (rest_framework_services.viewsets, rest_framework_services.views, rest_framework_services.mutations, rest_framework_services.types, rest_framework_services.exceptions, rest_framework_services.selectors, rest_framework_services.services) are stable too.

from rest_framework_services import (
    # views
    ServiceCreateView,
    ServiceUpdateView,
    ServiceDeleteView,
    SelectorListView,
    SelectorRetrieveView,
    MutationFlowMixin,
    # viewsets
    ServiceViewSet,
    SelectorViewSet,
    ServiceCreateMixin,
    ServiceUpdateMixin,
    ServiceDestroyMixin,
    SelectorListMixin,
    SelectorRetrieveMixin,
    ActionSerializerResolver,
    service_action,
    selector_action,
    # mutations
    apply_input,
    create_from_input,
    update_from_input,
    acreate_from_input,
    aupdate_from_input,
    # services
    CreateService,
    UpdateService,
    DeleteService,
    create_model,
    update_model,
    delete_model,
    acreate_model,
    aupdate_model,
    adelete_model,
    call_service,
    acall_service,
    implements,
    # selectors
    Selector,
    AsyncSelector,
    ListSelector,
    RetrieveSelector,
    call_selector,
    acall_selector,
    # types
    ServiceSpec,
    SelectorSpec,
    SelectorKind,
    ServiceView,
    ChangeResult,
    FieldChange,
    UNSET,
    UnsetType,
    NoInput,
    HttpExtras,
    # exceptions
    ServiceError,
    ServiceValidationError,
)