[1.1.X] Fixed #11785 -- Clarified error message when the layer geometry type doesn't match the model field. Thanks, esizikov for bug report and initial patch.

Backport of r12880 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12881 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2010-03-29 18:34:09 +00:00
parent ceb5261276
commit 08d00942d0
1 changed files with 2 additions and 1 deletions

View File

@ -290,7 +290,8 @@ class LayerMapping(object):
# Making sure that the OGR Layer's Geometry is compatible.
ltype = self.layer.geom_type
if not (gtype == ltype or self.make_multi(ltype, model_field)):
raise LayerMapError('Invalid mapping geometry; model has %s, feature has %s.' % (fld_name, gtype))
raise LayerMapError('Invalid mapping geometry; model has %s, '
'layer geometry type is %s.' % (fld_name, ltype))
# Setting the `geom_field` attribute w/the name of the model field
# that is a Geometry.