Sospecho que se debe a que no has leído la documentación.
Entre los [1]primeros pasos del [2]tutorial de GeoDjango, mas
específicamente en la sección que trata cómo definir modelos
"geográficos" se lee:
"...
Two important things to note:
1. The models module is imported from django.contrib.gis.db.
2. The model overrides its default manager with GeoManager; this is
required to perform spatial queries.
..."
Estás haciendo bien el item 1 pero no el item 2.
Probando la modificación sugerida con SpatiaLite, Django 1.4beta1 y
poniendo tu modelo Location::
from django.contrib.gis.db import models
class Location(models.Model):
name = models.CharField(max_length=30, null=True)
location = models.PointField(srid=4326)
datestamp = models.DateTimeField(auto_now=False, auto_now_add=True)
objects = models.GeoManager()
def __unicode__(self):
return self.name
...en una app llamada geomodel, obtengo::
$ PYTHONPATH=~/django/upstream/ ./manage.py shell
SpatiaLite version ..: 3.0.0-beta Supported Extensions:
- 'VirtualShape' [direct Shapefile access]
- 'VirtualDbf' [direct Dbf access]
- 'VirtualText' [direct CSV/TXT access]
- 'VirtualXL' [direct XLS access]
- 'VirtualText' [direct CSV/TXT access]
- 'VirtualNetwork' [Dijkstra shortest path]
- 'RTree' [Spatial Index - R*Tree]
- 'MbrCache' [Spatial Index - MBR cache]
- 'VirtualSpatialIndex' [R*Tree metahandler]
- 'VirtualFDO' [FDO-OGR interoperability]
- 'SpatiaLite' [Spatial SQL - OGC]
PROJ.4 Rel. 4.7.1, 23 September 2009
GEOS version 3.2.2-CAPI-1.6.2
^[[APython 2.7.2+ (default, Jan 20 2012, 23:05:38)
Type "copyright", "credits" or "license" for more information.
IPython 0.12 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from geomodel.models import Location
In [2]: qs = Location.objects.all()
In [3]: type(qs)
Out[3]: django.contrib.gis.db.models.query.GeoQuerySet
In [4]:
Suerte,
--
Ramiro Morales
1. https://docs.djangoproject.com/en/1.3/ref/contrib/gis/tutorial/#defining-a-geographic-model
2. https://docs.djangoproject.com/en/1.3/ref/contrib/gis/tutorial/