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
a2575c11
Commit
a2575c11
authored
May 10, 2011
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bits of cleanup
parent
cc4c9a95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
djangorestframework/mixins.py
+8
-4
djangorestframework/resource.py
+2
-1
No files found.
djangorestframework/mixins.py
View file @
a2575c11
...
...
@@ -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
render
er.
"""Return the view's most preferred
pars
er.
(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``.
...
...
djangorestframework/resource.py
View file @
a2575c11
...
...
@@ -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
...
...
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