renaming the fields directory to fields_bak solved the issue...
Le 15/06/2010 11:23, guillaume a ᅵcrit :
The problem is that you've got some vestigal code from a previous
release in your Django tree --
`django/contrib/gis/db/models/fields/__init__.py` is no longer used, and
the module was renamed to `fields.py`.
This typically occurs when upgrading via SVN as it leaves the directory
when doing `svn update`.
-Justin
Le 15/06/2010 16:40, Justin Bronn a ᅵcrit :
I have a simple geographic model designed to store polygons :
class SpatialHits(models.Model):
month = models.IntegerField("Mois")
year = models.IntegerField("Annᅵe")
layer = models.ForeignKey(Layer)
geom = models.PolygonField(dim=2)
objects = models.GeoManager()
class Meta:
verbose_name_plural = "Bounding boxes"
def __unicode__(self):
return self.name
Then I want to add an objects to it :
I retrieve a bbox and make a polygon from it:
poly_obj = Polygon.from_bbox(vals)
# add the object
my_bbox = SpatialHits(layer=my_layer, month=now.month, year=now.year,
geom=poly_obj)
my_bbox.save()
the system then complains about the object conflicting with the 2 dims
geometry constraint. If I drop that constraint, the records are
definitely 3D. If i check poly_obj.wkt out before creating the new
object, it is a normal 2D object.
I think something is transforming it to a 3D object on the new record
initialization, but can't figure out how.
Thanks for your clues,
Regards,
Guillaume