aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/views.py
diff options
context:
space:
mode:
authorTom Christie2011-05-27 09:58:21 +0100
committerTom Christie2011-05-27 09:58:21 +0100
commitcefc6a25c239411f17740742a121a1045563d90c (patch)
tree00fd277dbc2e810ace38bc9f7846dc6baeaa2390 /djangorestframework/views.py
parent894bf34451d0b3ff73f75e3ea954088e9078bed8 (diff)
downloaddjango-rest-framework-cefc6a25c239411f17740742a121a1045563d90c.tar.bz2
forms/models can be set on the view as well as the resource
Diffstat (limited to 'djangorestframework/views.py')
-rw-r--r--djangorestframework/views.py23
1 files changed, 17 insertions, 6 deletions
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.