Django TastyPie Geo Distance Lookups
问题 I'm using TastyPie for Geo-distance lookups. That is a bit difficult, because oficially its not supported by TastyPie. On Github (https://gist.github.com/1067176) I found the following code-sample: def apply_sorting(self, objects, options=None): if options and "longitude" in options and "latitude" in options: return objects.distance(Point(float(options['latitude']), float(options['longitude']))).order_by('distance') return super(UserLocationResource, self).apply_sorting(objects, options) It