Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ParsePy
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
OpenEdx
ParsePy
Commits
9c5bd490
Commit
9c5bd490
authored
Jun 22, 2015
by
Dan Krause
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed ParseBase.execute body arg to avoid collisions
workaround for #113
parent
a66533a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
parse_rest/connection.py
+3
-3
parse_rest/datatypes.py
+1
-1
No files found.
parse_rest/connection.py
View file @
9c5bd490
...
...
@@ -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
...
...
parse_rest/datatypes.py
View file @
9c5bd490
...
...
@@ -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
])
...
...
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