aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2011-05-10 12:59:13 +0100
committerTom Christie2011-05-10 12:59:13 +0100
commita2575c1191104df024b41c58825b9a24d4c4ae2d (patch)
tree738b0911d77d4344b61b2bfb525ab1ce7a615a4d
parentcc4c9a9518bda227df78e511242172773358c95c (diff)
downloaddjango-rest-framework-a2575c1191104df024b41c58825b9a24d4c4ae2d.tar.bz2
Bits of cleanup
-rw-r--r--djangorestframework/mixins.py12
-rw-r--r--djangorestframework/resource.py3
2 files changed, 10 insertions, 5 deletions
diff --git a/djangorestframework/mixins.py b/djangorestframework/mixins.py
index 99f6719b..b80f5894 100644
--- a/djangorestframework/mixins.py
+++ b/djangorestframework/mixins.py
@@ -150,7 +150,9 @@ class RequestMixin(object):
return self._content
-
+ # TODO: Modify this so that it happens implictly, rather than being called explicitly
+ # ie accessing any of .DATA, .FILES, .content_type, .stream or .method will force
+ # form overloading.
def perform_form_overloading(self):
"""
Check the request to see if it is using form POST '_method'/'_content'/'_content_type' overrides.
@@ -199,6 +201,7 @@ class RequestMixin(object):
content_type})
+ # TODO: Acutally this needs to go into Resource
def validate(self, content):
"""
Validate, cleanup, and type-ify the request content.
@@ -209,6 +212,7 @@ class RequestMixin(object):
return content
+ # TODO: Acutally this needs to go into Resource
def get_bound_form(self, content=None):
"""
Return a bound form instance for the given content,
@@ -229,7 +233,7 @@ class RequestMixin(object):
@property
def default_parser(self):
- """Return the view's most preferred renderer.
+ """Return the view's most preferred parser.
(This has no behavioral effect, but is may be used by documenting renderers)"""
return self.parsers[0]
@@ -256,8 +260,8 @@ class ResponseMixin(object):
renderers = ()
- # TODO: wrap this behavior around dispatch(), ensuring it works well with
- # existing Django classes that use render_to_response.
+ # TODO: wrap this behavior around dispatch(), ensuring it works
+ # out of the box with existing Django classes that use render_to_response.
def render(self, response):
"""
Takes a ``Response`` object and returns an ``HttpResponse``.
diff --git a/djangorestframework/resource.py b/djangorestframework/resource.py
index 04442498..6b039059 100644
--- a/djangorestframework/resource.py
+++ b/djangorestframework/resource.py
@@ -6,6 +6,7 @@ import decimal
import inspect
import re
+# TODO: Replace this with new Serializer code based on Forms API.
class Resource(object):
"""A Resource determines how an object maps to a serializable entity.
@@ -61,7 +62,7 @@ class Resource(object):
if inspect.ismethod(f) and len(inspect.getargspec(f)[0]) == 1:
ret = _any(f())
else:
- ret = unicode(thing) # TRC TODO: Change this back!
+ ret = unicode(thing) # TRC
return ret