mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-15 02:53:18 +03:00
Added credits, fixed multipart forms and unicode output as per paul's bug reports.
This commit is contained in:
parent
027ffed210
commit
b749b950a1
4
CREDITS.txt
Normal file
4
CREDITS.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
Thanks to...
|
||||||
|
|
||||||
|
Jesper Noehr & the django-piston contributors for providing the starting point for this project.
|
||||||
|
Paul Bagwell - Suggestions & bugfixes.
|
|
@ -121,7 +121,7 @@ class ModelResource(Resource):
|
||||||
if inspect.ismethod(f) and len(inspect.getargspec(f)[0]) == 1:
|
if inspect.ismethod(f) and len(inspect.getargspec(f)[0]) == 1:
|
||||||
ret = _any(f())
|
ret = _any(f())
|
||||||
else:
|
else:
|
||||||
ret = str(thing) # TRC TODO: Change this back!
|
ret = unicode(thing) # TRC TODO: Change this back!
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
|
@ -118,3 +118,12 @@ class FormParser(BaseParser):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: Allow parsers to specify multiple media types
|
||||||
|
class MultipartParser(FormParser):
|
||||||
|
"""The default parser for multipart form data.
|
||||||
|
Return a dict containing a single value for each non-reserved parameter.
|
||||||
|
"""
|
||||||
|
|
||||||
|
media_type = 'multipart/form-data'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,8 @@ class Resource(ParserMixin, FormValidatorMixin, OverloadedContentMixin, Overload
|
||||||
# List of content-types the resource can read from
|
# List of content-types the resource can read from
|
||||||
parsers = ( parsers.JSONParser,
|
parsers = ( parsers.JSONParser,
|
||||||
parsers.XMLParser,
|
parsers.XMLParser,
|
||||||
parsers.FormParser )
|
parsers.FormParser,
|
||||||
|
parsers.MultipartParser )
|
||||||
|
|
||||||
# List of all authenticating methods to attempt
|
# List of all authenticating methods to attempt
|
||||||
authenticators = ( authenticators.UserLoggedInAuthenticator,
|
authenticators = ( authenticators.UserLoggedInAuthenticator,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user