'Validates that the input value can be converted to a Geometry
object (which is returned).  A ValidationError is raised if
the value cannot be instantiated as a Geometry.'

def clean(self, value):

    geom = super(GeometryField, self).clean(value)
    if (geom is None):
        return geom
    if ((str(geom.geom_type).upper() != self.geom_type) and (not (self.geom_type == u'GEOMETRY'))):
        raise forms.ValidationError(self.error_messages[u'invalid_geom_type'], code=u'invalid_geom_type')
    if (self.srid and (self.srid != (-1)) and (self.srid != geom.srid)):
        try:
            geom.transform(self.srid)
        except:
            raise forms.ValidationError(self.error_messages[u'transform_error'], code=u'transform_error')
    return geom
