dgrtwo/ParsePy — pull request #55 by folse (2014-08-20 04:19:00+00:00)
Title: Add Relation Query

Now it support relation query:

place = Place.Query.get(objectId="sscyMpfZJ2")
categorys = Category_Place.Query.relation_filter(category__relation=place)._relation_fetch()
print categorys

equal to :

import json,httplib,urllib
connection = httplib.HTTPSConnection('api.parse.com', 443)
params = urllib.urlencode({"where":json.dumps({
"$relatedTo": {
"object": {
"__type": "Pointer",
"className": "Place",
"objectId": "sscyMpfZJ2"
},
"key": "category"
}
})})
connection.connect()
connection.request('GET', '/1/classes/Category_Place?%s' % params, '', {
"X-Parse-Application-Id": "MQRrReTdb...",
"X-Parse-REST-API-Key": "44mp6LNg..."
})
resp = connection.getresponse().read()
result = json.loads(resp)
print result