#8881: LayerMapping Error with more than two fields geometry
------------------------------+---------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |       Owner:  nobody    
   Status:  new               |   Milestone:  post-1.0  
Component:  GIS               |     Version:  1.0-beta-1
 Keywords:                    |       Stage:  Unreviewed
Has_patch:  0                 |  
------------------------------+---------------------------------------------
 If my models have a two o more fields of type geometry:
 class Lugares(models.Model) :
     nombre = models.CharField(max_length=80)
     punto = models.MultiPointField(null=True, blank=True, srid=4326)
     poligono = models.MultiPolygonField(null=True, blank=True, srid=4326)
     objects =models.GeoManager()



 lm=LayerMapping(Lugares,'/home/woakas/nuevo.shp',
 mapping,unique={'poligono':'POLYGON','tipolugar':'Ciudad'})
 ---------------------------------------------------------------------------
 LayerMapError                             Traceback (most recent call
 last)

 /home/woakas/mig/Migtrace/trunk/src/<ipython console> in <module>()

 /usr/lib/python2.5/site-packages/django/contrib/gis/utils/layermapping.py
 in __init__(self, model, data, mapping, layer, source_srs, encoding,
 transaction_mode, transform, unique)
     186         # geometry column).
     187         self.model = model
 --> 188         self.geo_col = self.geometry_column()
     189
     190         # Checking the source spatial reference system, and
 getting

 /usr/lib/python2.5/site-packages/django/contrib/gis/utils/layermapping.py
 in geometry_column(self)
     516             return GeometryColumns.objects.get(**gc_kwargs)
     517         except Exception, msg:
 --> 518             raise LayerMapError('Geometry column does not exist
 for model. (did you run syncdb?):\n %s' % msg)
     519
     520     def make_multi(self, geom_type, model_field):

 LayerMapError: Geometry column does not exist for model. (did you run
 syncdb?):
  get() returned more than one GeometryColumns -- it returned 2! Lookup
 parameters were {'f_table_name': 'migtrace_lugares'}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8881>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to