Re: geodjango join problem

2008-09-05 Thread robstar

So it turns out MYSQL can't handle distance lookups...  has anyone
come up with a workaround to use mysql with geodjango for distance
lookups??
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: geodjango join problem

2008-09-03 Thread robstar

I forgot to paste it, but I did include objects = models.GeoManager()
in my class.

I also tried making a different object like geo_objects =
models.GeoManager() and ran that from the shell to make sure I was
invoking the right manager.

I still get that same traceback ... any ideas??



On Sep 2, 6:29 pm, Justin Bronn <[EMAIL PROTECTED]> wrote:
> > class Location(models.Model):
> >   geo_loc         = models.PointField()
>
> > The thing that strikes me as strange is that the geomanager doesn't
> > show up at all in the traceback...  not sure why I can't do a join on
> > geo_loc ?!
>
> > Thanks for your help.
>
> You need to put `objects = models.GeoManager()` in your `Location`
> model.  I don't see it in the code you provided.
>
> Regards,
> -Justin
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: geodjango join problem

2008-09-02 Thread robstar

Oops, forgot to paste that in .. I've got that in there.



On Sep 2, 6:29 pm, Justin Bronn <[EMAIL PROTECTED]> wrote:
> > class Location(models.Model):
> >   geo_loc         = models.PointField()
>
> > The thing that strikes me as strange is that the geomanager doesn't
> > show up at all in the traceback...  not sure why I can't do a join on
> > geo_loc ?!
>
> > Thanks for your help.
>
> You need to put `objects = models.GeoManager()` in your `Location`
> model.  I don't see it in the code you provided.
>
> Regards,
> -Justin
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: geodjango join problem

2008-09-02 Thread Justin Bronn

> class Location(models.Model):
>   geo_loc         = models.PointField()
>
> The thing that strikes me as strange is that the geomanager doesn't
> show up at all in the traceback...  not sure why I can't do a join on
> geo_loc ?!
>
> Thanks for your help.

You need to put `objects = models.GeoManager()` in your `Location`
model.  I don't see it in the code you provided.

Regards,
-Justin
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



geodjango join problem

2008-09-02 Thread robstar

Hi guys,

I just got geodjango installed and am trying to do a basic radius
query as shown on the wiki.

ver: Django-1.0-beta_2

class Location(models.Model):
  geo_loc = models.PointField()


This is the example:

from django.contrib.gis.geos import *
from suitengine.models import Location
from django.contrib.gis.measure import D

x = Point(-94.36229240, 33.75653901)
qs = Location.objects.filter(geo_loc__distance_lte=(x, D(km=7)))


Here is the error:

Traceback (most recent call last):
  File "", line 1, in 
  File "/root/django-svn/Django-1.0-beta_2/django/db/models/
manager.py", line 90, in filter
return self.get_query_set().filter(*args, **kwargs)
  File "/root/django-svn/Django-1.0-beta_2/django/db/models/query.py",
line 481, in filter
return self._filter_or_exclude(False, *args, **kwargs)
  File "/root/django-svn/Django-1.0-beta_2/django/db/models/query.py",
line 499, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
  File "/root/django-svn/Django-1.0-beta_2/django/db/models/sql/
query.py", line 1189, in add_q
can_reuse=used_aliases)
  File "/root/django-svn/Django-1.0-beta_2/django/db/models/sql/
query.py", line 1061, in add_filter
parts, opts, alias, True, allow_many, can_reuse=can_reuse)
  File "/root/django-svn/Django-1.0-beta_2/django/db/models/sql/
query.py", line 1377, in setup_joins
raise FieldError("Join on field %r not permitted." % name)
FieldError: Join on field 'geo_loc' not permitted.


The thing that strikes me as strange is that the geomanager doesn't
show up at all in the traceback...  not sure why I can't do a join on
geo_loc ?!

Thanks for your help.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---