'This accessor sets the proxied geometry with the geometry class
specified during initialization.  Values of None, HEXEWKB, or WKT may
be used to set the geometry as well.'

def __set__(self, obj, value):

    gtype = self._field.geom_type
    if (isinstance(value, self._klass) and ((str(value.geom_type).upper() == gtype) or (gtype == 'GEOMETRY'))):
        if (value.srid is None):
            value.srid = self._field.srid
    elif ((value is None) or isinstance(value, (six.string_types + (memoryview,)))):
        pass
    else:
        raise TypeError(('cannot    set    %s    GeometryProxy    with    value    of    type:    %s' % (obj.__class__.__name__, type(value))))
    obj.__dict__[self._field.attname] = value
    return value
