Commit 37d06062 by Dave Gadling

Fix the relatedTo operator in Query

Before this we were never passing in all of the data required for the
relation lookup to work.

Figured this out after looking at the 4th code example at
https://parse.com/docs/rest#queries-relational and comparing to the
request that was actually being sent.

All the tests pass now.
parent 7ec07d1f
...@@ -126,7 +126,7 @@ class Queryset(object): ...@@ -126,7 +126,7 @@ class Queryset(object):
if operator is None: if operator is None:
q._where[attr] = parse_value q._where[attr] = parse_value
elif operator == 'relatedTo': elif operator == 'relatedTo':
q._where['$' + operator] = parse_value q._where['$' + operator] = {'object': parse_value, 'key': attr}
else: else:
if not isinstance(q._where[attr], dict): if not isinstance(q._where[attr], dict):
q._where[attr] = {} q._where[attr] = {}
......
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