Merge pull request #1082 from hydrogen18/master

Fixed some documentation on the MultiPartParser
This commit is contained in:
Marc Tamlyn 2013-05-18 01:37:08 -07:00
commit 1d3d04070e
1 changed files with 6 additions and 5 deletions

View File

@ -48,8 +48,8 @@ class MultiPartParser(object):
The standard ``META`` dictionary in Django request objects. The standard ``META`` dictionary in Django request objects.
:input_data: :input_data:
The raw post data, as a file-like object. The raw post data, as a file-like object.
:upload_handler: :upload_handlers:
An UploadHandler instance that performs operations on the uploaded A list of UploadHandler instances that perform operations on the uploaded
data. data.
:encoding: :encoding:
The encoding with which to treat the incoming data. The encoding with which to treat the incoming data.
@ -113,14 +113,15 @@ class MultiPartParser(object):
if self._content_length == 0: if self._content_length == 0:
return QueryDict('', encoding=self._encoding), MultiValueDict() return QueryDict('', encoding=self._encoding), MultiValueDict()
# See if the handler will want to take care of the parsing. # See if any of the handlers take care of the parsing.
# This allows overriding everything if somebody wants it. # This allows overriding everything if need be.
for handler in handlers: for handler in handlers:
result = handler.handle_raw_input(self._input_data, result = handler.handle_raw_input(self._input_data,
self._meta, self._meta,
self._content_length, self._content_length,
self._boundary, self._boundary,
encoding) encoding)
#Check to see if it was handled
if result is not None: if result is not None:
return result[0], result[1] return result[0], result[1]