Skip to content

Instantly share code, notes, and snippets.

@philipn
Created August 4, 2012 22:31
Show Gist options
  • Save philipn/3260364 to your computer and use it in GitHub Desktop.
Save philipn/3260364 to your computer and use it in GitHub Desktop.
tastypie gis queryset methods
the distance method takes a geom argument:
Map.objects.distance(geom).order_by('distance') -->
/api/map/?objects.distance=<geom>&order_by=distance
the area method takes no arguments:
Map.objects.area().order_by('area') -->
/api/map/?objects.area&order_by=area
nasty to allow a qs parameter w/o a value?h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment