Commit 9c5bd490 by Dan Krause

renamed ParseBase.execute body arg to avoid collisions

workaround for #113
parent a66533a2
......@@ -67,7 +67,7 @@ class ParseBase(object):
ENDPOINT_ROOT = API_ROOT
@classmethod
def execute(cls, uri, http_verb, extra_headers=None, batch=False, body=None, **kw):
def execute(cls, uri, http_verb, extra_headers=None, batch=False, _body=None, **kw):
"""
if batch == False, execute a command with the given parameters and
return the response JSON.
......@@ -88,10 +88,10 @@ class ParseBase(object):
master_key = ACCESS_KEYS.get('master_key')
url = uri if uri.startswith(API_ROOT) else cls.ENDPOINT_ROOT + uri
if body is None:
if _body is None:
data = kw and json.dumps(kw, default=date_handler) or "{}"
else:
data = body
data = _body
if http_verb == 'GET' and data:
url += '?%s' % urlencode(kw)
data = None
......
......@@ -225,7 +225,7 @@ class File(ParseType, ParseBase):
raise ParseError("Files can't be overwritten")
uri = '/'.join([self.__class__.ENDPOINT_ROOT, self.name])
headers = {'Content-type': self.mimetype}
response = self.__class__.POST(uri, extra_headers=headers, batch=batch, body=self._content)
response = self.__class__.POST(uri, extra_headers=headers, batch=batch, _body=self._content)
self._file_url = response['url']
self._name = response['name']
self._api_url = '/'.join([API_ROOT, 'files', self._name])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment