The following code will filter properly:
def nearby(self, latitude, longitude, proximity=None):
"""Get nearby Merchants.
Custom queryset method for getting merchants associated with
nearby places.
Returns:
A queryset of ``Merchant`` objects.
"""
point = Point(latitude, longitude)
# we query for location nearby for places first and then
# annotate with distance to the same place
return self.filter(
places__location__distance_lte=(point, D(ft=proximity))
).annotate(distance=models.Min(Distance('places__location', point)))
but the value returned by
models.Min(Distance('places__location', point))
is in meters.
Is it possible to get it in feet?