class documentation

Base class for all other generic views.

Method filter_queryset Given a queryset, filter it with whichever filter backend is in use.
Method get_object Returns the object the view is displaying.
Method get_paginated_response Return a paginated style `Response` object for the given output data.
Method get_queryset Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using `self.queryset`.
Method get_serializer Return the serializer instance that should be used for validating and deserializing input, and for serializing output.
Method get_serializer_class Return the class to use for the serializer. Defaults to using `self.serializer_class`.
Method get_serializer_context Extra context provided to the serializer class.
Method paginate_queryset Return a single page of results, or `None` if pagination is disabled.
Class Variable lookup_field Undocumented
Class Variable lookup_url_kwarg Undocumented
Class Variable queryset Undocumented
Class Variable serializer_class Undocumented
Property paginator The paginator instance associated with the view, or `None`.

Inherited from APIView:

Class Method as_view Store the original class on the view function.
Method check_object_permissions Check if the request should be permitted for a given object. Raises an appropriate exception if the request is not permitted.
Method check_permissions Check if the request should be permitted. Raises an appropriate exception if the request is not permitted.
Method check_throttles Check if request should be throttled. Raises an appropriate exception if the request is throttled.
Method determine_version If versioning is being used, then determine any API version for the incoming request. Returns a two-tuple of (version, versioning_scheme)
Method dispatch `.dispatch()` is pretty much the same as Django's regular dispatch, but with extra hooks for startup, finalize, and exception handling.
Method finalize_response Returns the final response object.
Method get_authenticate_header If a request is unauthenticated, determine the WWW-Authenticate header to use for 401 responses, if any.
Method get_authenticators Instantiates and returns the list of authenticators that this view can use.
Method get_content_negotiator Instantiate and return the content negotiation class to use.
Method get_exception_handler Returns the exception handler that this view uses.
Method get_exception_handler_context Returns a dict that is passed through to EXCEPTION_HANDLER, as the `context` argument.
Method get_format_suffix Determine if the request includes a '.json' style format suffix
Method get_parser_context Returns a dict that is passed through to Parser.parse(), as the `parser_context` keyword argument.
Method get_parsers Instantiates and returns the list of parsers that this view can use.
Method get_permissions Instantiates and returns the list of permissions that this view requires.
Method get_renderer_context Returns a dict that is passed through to Renderer.render(), as the `renderer_context` keyword argument.
Method get_renderers Instantiates and returns the list of renderers that this view can use.
Method get_throttles Instantiates and returns the list of throttles that this view uses.
Method get_view_description Return some descriptive text for the view, as used in OPTIONS responses and in the browsable API.
Method get_view_name Return the view name, as used in OPTIONS responses and in the browsable API.
Method handle_exception Handle any exception that occurs, by returning an appropriate response, or re-raising the error.
Method http_method_not_allowed If `request.method` does not correspond to a handler method, determine what kind of exception to raise.
Method initial Runs anything that needs to occur prior to calling the method handler.
Method initialize_request Returns the initial request object.
Method options Handler method for HTTP 'OPTIONS' request.
Method perform_authentication Perform authentication on the incoming request.
Method perform_content_negotiation Determine which renderer and media type to use render the response.
Method permission_denied If request is not permitted, determine what kind of exception to raise.
Method raise_uncaught_exception Undocumented
Method throttled If request is throttled, determine what kind of exception to raise.
Class Variable schema Undocumented
Instance Variable args Undocumented
Instance Variable format_kwarg Undocumented
Instance Variable headers Undocumented
Instance Variable kwargs Undocumented
Instance Variable request Undocumented
Instance Variable response Undocumented
Property allowed_methods Wrap Django's private `_allowed_methods` interface in a public property.
Property default_response_headers Undocumented
Instance Variable _negotiator Undocumented
def filter_queryset(self, queryset): (source)

Given a queryset, filter it with whichever filter backend is in use. You are unlikely to want to override this method, although you may need to call it either from a list view, or from a custom `get_object` method if you want to apply the configured filtering backend to the default queryset.

def get_object(self): (source)

Returns the object the view is displaying. You may want to override this if you need to provide non-standard queryset lookups. Eg if objects are referenced using multiple keyword arguments in the url conf.

def get_paginated_response(self, data): (source)

Return a paginated style `Response` object for the given output data.

def get_queryset(self): (source)

Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using `self.queryset`. This method should always be used rather than accessing `self.queryset` directly, as `self.queryset` gets evaluated only once, and those results are cached for all subsequent requests. You may want to override this if you need to provide different querysets depending on the incoming request. (Eg. return a list of items that is specific to the user)

def get_serializer(self, *args, **kwargs): (source)

Return the serializer instance that should be used for validating and deserializing input, and for serializing output.

def get_serializer_class(self): (source)

Return the class to use for the serializer. Defaults to using `self.serializer_class`. You may want to override this if you need to provide different serializations depending on the incoming request. (Eg. admins get full serialization, others get basic serialization)

def get_serializer_context(self): (source)

Extra context provided to the serializer class.

def paginate_queryset(self, queryset): (source)

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

lookup_field: str = (source)

Undocumented

lookup_url_kwarg = (source)

Undocumented

queryset = (source)

Undocumented

serializer_class = (source)

Undocumented

The paginator instance associated with the view, or `None`.