Nov 9, 2011

Finding the nearest with the ORM

from django.contrib.gis.geos import Point
lawrence = Point((-95.234657999999996, 38.972679999999997))
Campground.objects.all().distance(lawrence).order_by('distance')

No comments: