Re: possible bug in joining on a geo field

2010-12-19 Thread felix
ah no, now I get it: geo queries requires a GeoManager. so even though the starting class does not have gis fields, it needs a GeoManager in order to build queries addressing fields on the other model. I'm not sure what should happen, the error messaging is very misleading, but once you know t

Re: possible bug in joining on a geo field

2010-12-18 Thread felix
I have discovered the exact same issue. class Apt(Model): geo = models.PointField(srid=4326,editable=False,default=Point(0,0)) bldg = models.ForeignKey(Bldg,null=True) class AptStatus(Model): apt = models.ForeignKey(Apt) class DP_5cbc61d6(Model): apt = models.Fo

Re: possible bug in joining on a geo field

2010-10-25 Thread Miguel Araujo
Should I report it? who should I contact? Anyone can confirm this is a bug? 2010/10/23 Miguel Araujo > Thanks Karen, you are right. But I missed the underscore for sending this, > although I was trying here with double underscore: > > So If I do it right: > > Item.objects.filter(location__point_

Re: possible bug in joining on a geo field

2010-10-23 Thread Miguel Araujo
Thanks Karen, you are right. But I missed the underscore for sending this, although I was trying here with double underscore: So If I do it right: Item.objects.filter(location__point__distance__lte = (point, D(km=10))) I get: FieldError: Join on field 'point' not permitted. Did you misspell 'di

Re: possible bug in joining on a geo field

2010-10-23 Thread Karen Tracey
On Sat, Oct 23, 2010 at 1:07 PM, Miguel Araujo wrote: > Item.objects.filter(location__point__distance_lte = (point, D(km=10))) > Looks like you are missing an underscore in distance__lte Karen -- http://tracey.org/kmt/ -- You received this message because you are subscribed to the Google Gro

possible bug in joining on a geo field

2010-10-23 Thread Miguel Araujo
Hi everyone, 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.d