Commit 0a5ca000 by Ben Timby

Docstring/whitespace fixes.

parent 5f4096ca
...@@ -49,12 +49,12 @@ class RequestMixin(object): ...@@ -49,12 +49,12 @@ class RequestMixin(object):
_CONTENTTYPE_PARAM = '_content_type' _CONTENTTYPE_PARAM = '_content_type'
_CONTENT_PARAM = '_content' _CONTENT_PARAM = '_content'
parsers = ()
""" """
The set of request parsers that the view can handle. The set of request parsers that the view can handle.
Should be a tuple/list of classes as described in the :mod:`parsers` module. Should be a tuple/list of classes as described in the :mod:`parsers` module.
""" """
parsers = ()
@property @property
def method(self): def method(self):
...@@ -226,12 +226,12 @@ class ResponseMixin(object): ...@@ -226,12 +226,12 @@ class ResponseMixin(object):
_ACCEPT_QUERY_PARAM = '_accept' # Allow override of Accept header in URL query params _ACCEPT_QUERY_PARAM = '_accept' # Allow override of Accept header in URL query params
_IGNORE_IE_ACCEPT_HEADER = True _IGNORE_IE_ACCEPT_HEADER = True
renderers = ()
""" """
The set of response renderers that the view can handle. The set of response renderers that the view can handle.
Should be a tuple/list of classes as described in the :mod:`renderers` module. Should be a tuple/list of classes as described in the :mod:`renderers` module.
""" """
renderers = ()
# TODO: wrap this behavior around dispatch(), ensuring it works # TODO: wrap this behavior around dispatch(), ensuring it works
...@@ -339,19 +339,19 @@ class AuthMixin(object): ...@@ -339,19 +339,19 @@ class AuthMixin(object):
Simple :class:`mixin` class to add authentication and permission checking to a :class:`View` class. Simple :class:`mixin` class to add authentication and permission checking to a :class:`View` class.
""" """
authentication = ()
""" """
The set of authentication types that this view can handle. The set of authentication types that this view can handle.
Should be a tuple/list of classes as described in the :mod:`authentication` module. Should be a tuple/list of classes as described in the :mod:`authentication` module.
""" """
authentication = ()
permissions = ()
""" """
The set of permissions that will be enforced on this view. The set of permissions that will be enforced on this view.
Should be a tuple/list of classes as described in the :mod:`permissions` module. Should be a tuple/list of classes as described in the :mod:`permissions` module.
""" """
permissions = ()
@property @property
......
...@@ -63,6 +63,3 @@ class UserAgentMungingTest(TestCase): ...@@ -63,6 +63,3 @@ class UserAgentMungingTest(TestCase):
resp = self.view(req) resp = self.view(req)
self.assertEqual(resp['Content-Type'], 'application/json') self.assertEqual(resp['Content-Type'], 'application/json')
...@@ -30,7 +30,3 @@ class UploadFilesTests(TestCase): ...@@ -30,7 +30,3 @@ class UploadFilesTests(TestCase):
response = view(request) response = view(request)
self.assertEquals(response.content, '{"FILE_CONTENT": "stuff", "FILE_NAME": "stuff.txt"}') self.assertEquals(response.content, '{"FILE_CONTENT": "stuff", "FILE_NAME": "stuff.txt"}')
...@@ -172,7 +172,6 @@ class TestXMLParser(TestCase): ...@@ -172,7 +172,6 @@ class TestXMLParser(TestCase):
'field_b': 'dasd', 'field_b': 'dasd',
'field_c': None, 'field_c': None,
'field_d': datetime.datetime(2011, 12, 25, 12, 45, 00) 'field_d': datetime.datetime(2011, 12, 25, 12, 45, 00)
} }
self._complex_data_input = StringIO( self._complex_data_input = StringIO(
'<?xml version="1.0" encoding="utf-8"?>' '<?xml version="1.0" encoding="utf-8"?>'
......
...@@ -32,32 +32,32 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): ...@@ -32,32 +32,32 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
Performs request deserialization, response serialization, authentication and input validation. Performs request deserialization, response serialization, authentication and input validation.
""" """
resource = None
""" """
The resource to use when validating requests and filtering responses, The resource to use when validating requests and filtering responses,
or `None` to use default behaviour. or `None` to use default behaviour.
""" """
resource = None
renderers = renderers.DEFAULT_RENDERERS
""" """
List of renderers the resource can serialize the response with, ordered by preference. List of renderers the resource can serialize the response with, ordered by preference.
""" """
renderers = renderers.DEFAULT_RENDERERS
parsers = parsers.DEFAULT_PARSERS
""" """
List of parsers the resource can parse the request with. List of parsers the resource can parse the request with.
""" """
parsers = parsers.DEFAULT_PARSERS
authentication = ( authentication.UserLoggedInAuthentication,
authentication.BasicAuthentication )
""" """
List of all authenticating methods to attempt. List of all authenticating methods to attempt.
""" """
authentication = ( authentication.UserLoggedInAuthentication,
authentication.BasicAuthentication )
permissions = ( permissions.FullAnonAccess, )
""" """
List of all permissions that must be checked. List of all permissions that must be checked.
""" """
permissions = ( permissions.FullAnonAccess, )
@classmethod @classmethod
def as_view(cls, **initkwargs): def as_view(cls, **initkwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment