summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2010-03-29 18:34:09 +0000
committerJustin Bronn <jbronn@gmail.com>2010-03-29 18:34:09 +0000
commit08d00942d057bdf9a7a7da650657c88bc23a08e1 (patch)
treeee1af72535571749e4ea493eb1b37094aee0a544
parentceb52612769ec7e211cc4a8909f4247107d454b3 (diff)
[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
-rw-r--r--django/contrib/gis/utils/layermapping.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/gis/utils/layermapping.py b/django/contrib/gis/utils/layermapping.py
index 57c957811d..1d9e90423d 100644
--- a/django/contrib/gis/utils/layermapping.py
+++ b/django/contrib/gis/utils/layermapping.py
@@ -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.