summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/contrib/gis/gdal/Field.py2
-rw-r--r--django/contrib/gis/utils/LayerMapping.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/django/contrib/gis/gdal/Field.py b/django/contrib/gis/gdal/Field.py
index ce183990bc..340c9bfa1b 100644
--- a/django/contrib/gis/gdal/Field.py
+++ b/django/contrib/gis/gdal/Field.py
@@ -25,7 +25,7 @@ class Field(object):
def __str__(self):
"Returns the string representation of the Field."
- return '%s (%s)' % (self.name, self.__class__.__name__)
+ return '%s (%s)' % (self.name, self.value)
#### Field Properties ####
@property
diff --git a/django/contrib/gis/utils/LayerMapping.py b/django/contrib/gis/utils/LayerMapping.py
index 9f154f8b06..b768c52a07 100644
--- a/django/contrib/gis/utils/LayerMapping.py
+++ b/django/contrib/gis/utils/LayerMapping.py
@@ -158,7 +158,7 @@ def check_feature(feat, model_fields, mapping):
geom = feat.geom
gtype = geom.geom_type
gname = geom.geom_name
-
+
if make_multi(gname, model_type):
# Do we have to 'upsample' into a Geometry Collection?
pass
@@ -166,7 +166,7 @@ def check_feature(feat, model_fields, mapping):
# The geometry type otherwise was expected
pass
else:
- raise Exception, 'Invalid mapping geometry!'
+ raise Exception, 'Invalid mapping geometry; model has %s, feature has %s' % (model_type, gtype)
## Handling other fields
else:
@@ -237,10 +237,10 @@ class LayerMapping:
if ogr_field in ogc_types:
## Getting the OGR geometry from the field
geom = feat.geom
-
+
if make_multi(geom.geom_name, model_type):
# Constructing a multi-geometry type to contain the single geometry
- multi_type = multi_types[gname]
+ multi_type = multi_types[geom.geom_name]
g = OGRGeometry(multi_type)
g.add(geom)
else: