I'm trying to do a join on geo field. I have two models like these ones (simplified):
from django.contrib.gis.db import models
class Spot(models.Model):
point = models.PointField(spatial_index = True, srid = 4326, geography = True)
objects = models.GeoManager()
from django.db import models
class Item(models.Model):
location = models.ForeignKey(Spot)
description = models.CharField(max_length=100)
I'm trying to execute this query:
from django.contrib.gis.geos import Point
point = Point(4, 5)
Item.objects.filter(location__point__distance_lte = (point, D(km=10)))
And I'm getting:
FieldError: Join on field 'point' not permitted. Did you misspell 'distance_lte' for the lookup type?
is this a bug? should I report it in a ticket? am I doing anything wrong?
Thanks, regards
Miguel Araujo
-- You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment