Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
e227c38b
Commit
e227c38b
authored
Jan 27, 2011
by
tom christie tom@tomchristie.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed is_error in Response
parent
d38f7f3e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
flywheel/emitters.py
+1
-1
flywheel/resource.py
+2
-3
flywheel/response.py
+2
-3
No files found.
flywheel/emitters.py
View file @
e227c38b
...
...
@@ -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
:
...
...
flywheel/resource.py
View file @
e227c38b
...
...
@@ -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
#
...
...
flywheel/response.py
View file @
e227c38b
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment