'Prepare the cache, making sure that proxies of the same db base
share the same cache.'

def _prepare(cls):

    dbmodel = (cls._meta.proxy_for_model if cls._meta.proxy else cls)
    cls.__dbclass__ = dbmodel
    if (not hasattr(dbmodel, '__instance_cache__')):
        dbmodel.__instance_cache__ = {}
    super(SharedMemoryModelBase, cls)._prepare()
