The mixins module provides a set of reusable mixin classes that can be added to a View.
Mixin class to provide request parsing behavior.
Returns the HTTP method.
This should be used instead of just reading request.method, as it allows the method to be overridden by using a hidden form field on a form POST request.
Returns the content type header.
This should be used instead of request.META.get('HTTP_CONTENT_TYPE'), as it allows the content type to be overridden by using a hidden form field on a form POST request.
Adds behavior for pluggable Renderers to a views.View class.
Default behavior is to use standard HTTP Accept header content negotiation. Also supports overriding the content type by specifying an _accept= parameter in the URL. Ignores Accept headers from Internet Explorer user agents and uses a sensible browser Accept header instead.
Simple mixin class to add authentication and permission checking to a View class.
The set of permissions that will be enforced on this view.
Should be a tuple/list of classes as described in the permissions module.
Returns the user for the current request, as determined by the set of authentication classes applied to the View.
Provides request validation and response filtering behavior.
Should be a class as described in the resources module.
The resource is an object that maps a view onto it’s representation on the server.
It provides validation on the content of incoming requests, and filters the object representation into a serializable object for the response.
Returns the cleaned, validated request content.
May raise an response.ErrorResponse with status code 400 (Bad Request).
Returns the cleaned, validated query parameters.
May raise an response.ErrorResponse with status code 400 (Bad Request).
Given the request data and optional files, return the cleaned, validated content. May raise an response.ErrorResponse with status code 400 (Bad Request) on failure.