Coverage for rest_framework/views : - 100% -
-
- From f2e6af89755c34083acb1a5fcd843a480037293f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 21 Jun 2013 22:04:38 +0100 Subject: Remove erronous htmlcov files --- htmlcov/rest_framework_views.html | 793 -------------------------------------- 1 file changed, 793 deletions(-) delete mode 100644 htmlcov/rest_framework_views.html (limited to 'htmlcov/rest_framework_views.html') diff --git a/htmlcov/rest_framework_views.html b/htmlcov/rest_framework_views.html deleted file mode 100644 index f836e71f..00000000 --- a/htmlcov/rest_framework_views.html +++ /dev/null @@ -1,793 +0,0 @@ - - -
- - - - -
-
-Hot-keys on this page
-- r - m - x - p toggle line displays -
-- j - k next/prev highlighted chunk -
-- 0 (zero) top of page -
-- 1 (one) first highlighted chunk -
-| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -
- """ -Provides an APIView class that is the base of all views in REST framework. -""" - -- - - - - - - - - - - - - - - - - - - - - - - - def as_view(cls, **initkwargs): -""" -Store the original class on the view function. -- This allows us to discover information about the view when we do URL -reverse lookups. Used for breadcrumb generation. -""" - - - -- - def allowed_methods(self): -""" -Wrap Django's private `_allowed_methods` interface in a public property. -""" - -- - def default_response_headers(self): -# TODO: deprecate? -# TODO: Only vary by accept if multiple renderers - -'Allow': ', '.join(self.allowed_methods), -'Vary': 'Accept' -} -- - """ -If `request.method` does not correspond to a handler method, -determine what kind of exception to raise. -""" - -- - """ -If request is not permitted, determine what kind of exception to raise. -""" - - - -- - """ -If request is throttled, determine what kind of exception to raise. -""" - -- - """ -If a request is unauthenticated, determine the WWW-Authenticate -header to use for 401 responses, if any. -""" - - - -- - """ -Returns a dict that is passed through to Parser.parse(), -as the `parser_context` keyword argument. -""" -# Note: Additionally `request` will also be added to the context -# by the Request object. - -'view': self, -'args': getattr(self, 'args', ()), -'kwargs': getattr(self, 'kwargs', {}) -} -- - """ -Returns a dict that is passed through to Renderer.render(), -as the `renderer_context` keyword argument. -""" -# Note: Additionally 'response' will also be added to the context, -# by the Response object. - -'view': self, -'args': getattr(self, 'args', ()), -'kwargs': getattr(self, 'kwargs', {}), -'request': getattr(self, 'request', None) -} -- # API policy instantiation methods -- - """ -Determine if the request includes a '.json' style format suffix -""" - - -- - """ -Instantiates and returns the list of renderers that this view can use. -""" - -- - """ -Instantiates and returns the list of parsers that this view can use. -""" - -- - """ -Instantiates and returns the list of authenticators that this view can use. -""" - -- - """ -Instantiates and returns the list of permissions that this view requires. -""" - -- - """ -Instantiates and returns the list of throttles that this view uses. -""" - -- - """ -Instantiate and return the content negotiation class to use. -""" - - - -- # API policy implementation methods -- - """ -Determine which renderer and media type to use render the response. -""" - - -- - - - - - - - - """ -Perform authentication on the incoming request. -- Note that if you override this and simply 'pass', then authentication -will instead be performed lazily, the first time either -`request.user` or `request.auth` is accessed. -""" - -- - """ -Check if the request should be permitted. -Raises an appropriate exception if the request is not permitted. -""" - - - -- - """ -Check if the request should be permitted for a given object. -Raises an appropriate exception if the request is not permitted. -""" - - - -- - """ -Check if request should be throttled. -Raises an appropriate exception if the request is throttled. -""" - - - -- # Dispatch methods -- - """ -Returns the initial request object. -""" - -- - parsers=self.get_parsers(), -authenticators=self.get_authenticators(), -negotiator=self.get_content_negotiator(), -parser_context=parser_context) -- - """ -Runs anything that needs to occur prior to calling the method handler. -""" - -- # Ensure that the incoming request is permitted - - - -- # Perform content negotiation and store the accepted info on the request - - -- - """ -Returns the final response object. -""" -# Make the error obvious if a proper response is not returned - -'Expected a `Response` to be returned from the view, ' -'but received a `%s`' % type(response) -) -- - - - - - - - - - - - - - - - """ -Handle any exception that occurs, by returning an appropriate response, -or re-raising the error. -""" - -# Throttle wait header - -- - exceptions.AuthenticationFailed)): -# WWW-Authenticate header for 401 responses, else coerce to 403 - -- - - else: - -- - - status=exc.status_code, -exception=True) - - -status=status.HTTP_404_NOT_FOUND, -exception=True) - - -status=status.HTTP_403_FORBIDDEN, -exception=True) - -- # Note: session based authentication is explicitly CSRF validated, -# all other authentication is CSRF exempt. - -def dispatch(self, request, *args, **kwargs): -""" -`.dispatch()` is pretty much the same as Django's regular dispatch, -but with extra hooks for startup, finalize, and exception handling. -""" - - - - - -- - - - # Get the appropriate handler method - - -self.http_method_not_allowed) -else: - -- - - - - - - - - - """ -Handler method for HTTP 'OPTIONS' request. -We may as well implement this as Django will otherwise provide -a less useful default implementation. -""" - -- - """ -Return a dictionary of metadata about the view. -Used to return responses for OPTIONS requests. -""" -- # This is used by ViewSets to disambiguate instance vs list views - -- # By default we can't provide any form-like information, however the -# generic views override this implementation and add additional -# information for POST and PUT methods, based on the serializer. - - - - - - - - |
-