Ticket #9806: 9806.diff

File 9806.diff, 1.2 KB (added by ingenieroariel, 15 years ago)

Patch, tested in Firefox 3 on MacOSX

  • django/contrib/gis/admin/widgets.py

    diff --git a/django/contrib/gis/admin/widgets.py b/django/contrib/gis/admin/widgets.py
    index 27abc8f..fa1c468 100644
    a b class OpenLayersWidget(Textarea):  
    2323                value = GEOSGeometry(value)
    2424            except (GEOSException, ValueError):
    2525                value = None
    26 
    27         if value and value.geom_type.upper() != self.geom_type:
     26        if value and value.geom_type.upper() != self.geom_type and self.geom_type != 'GEOMETRY':
    2827            value = None
    2928
    3029        # Constructing the dictionary of the map options.
  • django/contrib/gis/gdal/geomtype.py

    diff --git a/django/contrib/gis/gdal/geomtype.py b/django/contrib/gis/gdal/geomtype.py
    index 565326f..8fedd49 100644
    a b class OGRGeomType(object):  
    2424        if isinstance(type_input, OGRGeomType):
    2525            num = type_input.num
    2626        elif isinstance(type_input, basestring):
     27            if type_input.lower() == 'geometry': type_input='unknown'
    2728            num = self._str_types.get(type_input.lower(), None)
    2829            if num is None:
    2930                raise OGRException('Invalid OGR String Type "%s"' % type_input)
Back to Top