From the tastypie sourcecode:
# If we are filtering on a GeometryApiField then we should try
# and convert this to a GEOSGeometry object. The conversion
# will fail if we don't have value JSON, so in that case we'll
# just return ``value`` as normal.
your D(m=3) is not valid JSON.
This is the Code that is translating the fields:
if isinstance(self.fields[field_name], GeometryApiField):
try:
value = GEOSGeometry(unquote(value))
except ValueError:
pass
return value
Since the following Code should work internally:
Location.objects.filter(location__distance_lte=(fromstr('POINT(153.09537 -27.52618)', srid=4326), D(m=5)))
I could imagine it would need to look a little like:
[{"type": "Point", "coordinates": [153.09537, -27.52618]},{"type": "D", "m" : 5}]
I am not yet getting this to run. Hope you have more luck with it!
EDIT:
Since I couldn't get this to run, I implemented it myself using
Django Tastypie Advanced Filtering: How to do complex lookups with Q objects
Not the ideal solution, but it works.