Commit f679b4d8 by dgrtwo

Added support and brief documentation of nearSphere operator for GeoPoints

parent e3f4a105
......@@ -283,6 +283,13 @@ Like Django, Querysets can have constraints added by appending the name of the f
high_scores = GameScore.Query.filter(score__gte=1000)
~~~~~
You can similarly perform queries on GeoPoint objects by using the `nearSphere` operator:
~~~~~ {python}
my_loc = GeoPoint(latitude=12.0, longitude=-34.55)
nearby_restaurants = Restaurant.Query.filter(location__nearSphere=my_loc)
~~~~~
You can see the [full list of constraint operators defined by
Parse](https://www.parse.com/docs/rest#queries-constraints)
......
......@@ -56,7 +56,7 @@ class QueryManager(object):
class Queryset(object):
OPERATORS = [
'lt', 'lte', 'gt', 'gte', 'ne', 'in', 'nin', 'exists', 'select', 'dontSelect', 'all', 'relatedTo'
'lt', 'lte', 'gt', 'gte', 'ne', 'in', 'nin', 'exists', 'select', 'dontSelect', 'all', 'relatedTo', 'nearSphere'
]
@staticmethod
......
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