diff --git a/django/contrib/gis/gdal/Field.py b/django/contrib/gis/gdal/Field.py index ce183990bc2a7..340c9bfa1b67f 100644 --- a/django/contrib/gis/gdal/Field.py +++ b/django/contrib/gis/gdal/Field.py @@ -25,7 +25,7 @@ def __init__(self, fld, val=''): 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 9f154f8b06b9b..b768c52a07147 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 @@ def save(self, verbose=False): 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: