aboutsummaryrefslogtreecommitdiffstats
path: root/flywheel
diff options
context:
space:
mode:
authortom christie tom@tomchristie.com2011-01-27 19:24:58 +0000
committertom christie tom@tomchristie.com2011-01-27 19:24:58 +0000
commite227c38b330988d71087759d13303215561808c6 (patch)
tree78c008e0b977bdb025f9d2d3d340124f66c253b0 /flywheel
parentd38f7f3ef7ab803a8b9babda8f6be989f378429e (diff)
downloaddjango-rest-framework-e227c38b330988d71087759d13303215561808c6.tar.bz2
Removed is_error in Response
Diffstat (limited to 'flywheel')
-rw-r--r--flywheel/emitters.py2
-rw-r--r--flywheel/resource.py5
-rw-r--r--flywheel/response.py5
3 files changed, 5 insertions, 7 deletions
diff --git a/flywheel/emitters.py b/flywheel/emitters.py
index 408a65eb..4ba2d92d 100644
--- a/flywheel/emitters.py
+++ b/flywheel/emitters.py
@@ -65,7 +65,7 @@ class DocumentingTemplateEmitter(BaseEmitter):
# Otherwise if this isn't an error response
# then attempt to get a form bound to the response object
- if not form_instance and not resource.response.is_error and resource.response.has_content_body:
+ if not form_instance and resource.response.has_content_body:
try:
form_instance = resource.get_form(resource.response.raw_content)
except:
diff --git a/flywheel/resource.py b/flywheel/resource.py
index c15f01ed..36f49792 100644
--- a/flywheel/resource.py
+++ b/flywheel/resource.py
@@ -12,11 +12,10 @@ from itertools import chain
# TODO: Display user login in top panel: http://stackoverflow.com/questions/806835/django-redirect-to-previous-page-after-login
# TODO: Figure how out references and named urls need to work nicely
# TODO: POST on existing 404 URL, PUT on existing 404 URL
-# TODO: Remove is_error throughout
#
+# NEXT: Validators to become generic, forms to move out of Resource into FormValidator
+# NEXT: Permissions to become generic, UserAllowed, Throttling
# NEXT: Exceptions on func() -> 500, tracebacks emitted if settings.DEBUG
-# NEXT: Generic content form
-# NEXT: Remove self.blah munging (Add a ResponseContext object?)
# NEXT: Caching cleverness
# NEXT: Test non-existent fields on ModelResources
#
diff --git a/flywheel/response.py b/flywheel/response.py
index d662ef29..4f23bb0a 100644
--- a/flywheel/response.py
+++ b/flywheel/response.py
@@ -106,13 +106,12 @@ class NoContent(object):
class Response(object):
- def __init__(self, status, content=NoContent, headers={}, is_error=False):
+ def __init__(self, status, content=NoContent, headers={}):
self.status = status
self.has_content_body = not content is NoContent
self.raw_content = content # content prior to filtering
self.cleaned_content = content # content after filtering
self.headers = headers
- self.is_error = is_error
@property
def status_text(self):
@@ -123,4 +122,4 @@ class Response(object):
class ResponseException(BaseException):
def __init__(self, status, content=NoContent, headers={}):
- self.response = Response(status, content=content, headers=headers, is_error=True)
+ self.response = Response(status, content=content, headers=headers)