'This accessor retrieves the geometry, initializing it using the geometry
class specified during initialization and the HEXEWKB value of the field.
Currently, only GEOS or OGR geometries are supported.'

def __get__(self, obj, type=None):

    if (obj is None):
        return self
    geom_value = obj.__dict__[self._field.attname]
    if isinstance(geom_value, self._klass):
        geom = geom_value
    elif ((geom_value is None) or (geom_value == '')):
        geom = None
    else:
        geom = self._klass(geom_value)
        setattr(obj, self._field.attname, geom)
    return geom
