diff options
| author | markotibold | 2011-05-19 19:36:30 +0200 |
|---|---|---|
| committer | markotibold | 2011-05-19 19:36:30 +0200 |
| commit | 82c4ca96126cfedd4a8471452d956e8bb432ba5b (patch) | |
| tree | f92502c69a826b6f0cea24a3054c3e893122dc36 /djangorestframework/views.py | |
| parent | e7f8c06dbbbc9e4ae91327ee02cd8147777b17e2 (diff) | |
| download | django-rest-framework-82c4ca96126cfedd4a8471452d956e8bb432ba5b.tar.bz2 | |
The core is now documented from the docstrings in the source.
Diffstat (limited to 'djangorestframework/views.py')
| -rw-r--r-- | djangorestframework/views.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/djangorestframework/views.py b/djangorestframework/views.py index 81567e68..626dc696 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -1,3 +1,10 @@ +""" +The :mod:`views` module provides the Views you will most probably +be subclassing in your implementation. + +By setting or modifying class attributes on your view, you change it's predefined behaviour. +""" + from django.core.urlresolvers import set_script_prefix from django.views.decorators.csrf import csrf_exempt @@ -26,25 +33,25 @@ class BaseView(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, View): # Use the base resource by default resource = resources.Resource - # 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 parsers the resource can parse the request with. + """ List of renderers the resource can serialize the response with, ordered by preference.""" + 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. # These are used for documentation in the standard html and text renderers. |
