From cefc6a25c239411f17740742a121a1045563d90c Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 27 May 2011 09:58:21 +0100 Subject: forms/models can be set on the view as well as the resource --- djangorestframework/views.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'djangorestframework/views.py') diff --git a/djangorestframework/views.py b/djangorestframework/views.py index cdb2ba33..1315229a 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -31,27 +31,38 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): Performs request deserialization, response serialization, authentication and input validation. """ - # Use the base resource by default - resource = resources.Resource + """ + The resource to use when validating requests and filtering responses, + or `None` to use default behaviour. + """ + resource = None + """ + List of renderers the resource can serialize the response with, ordered by preference. + """ renderers = ( renderers.JSONRenderer, renderers.DocumentingHTMLRenderer, renderers.DocumentingXHTMLRenderer, renderers.DocumentingPlainTextRenderer, renderers.XMLRenderer ) - """ List of renderers the resource can serialize the response with, ordered by preference.""" + """ + List of parsers the resource can parse the request with. + """ parsers = ( parsers.JSONParser, parsers.FormParser, parsers.MultiPartParser ) - """ List of parsers the resource can parse the request with.""" + """ + List of all authenticating methods to attempt. + """ authentication = ( authentication.UserLoggedInAuthenticaton, authentication.BasicAuthenticaton ) - """ List of all authenticating methods to attempt.""" + """ + List of all permissions that must be checked. + """ permissions = ( permissions.FullAnonAccess, ) - """ List of all permissions that must be checked.""" # Allow name and description for the Resource to be set explicitly, # overiding the default classname/docstring behaviour. -- cgit v1.2.3