cubicweb/pyramid/init_instance.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 30 Sep 2016 17:34:59 +0200
changeset 11781 4ebd968f364c
parent 11631 faf279e33298
permissions -rw-r--r--
[massive store] Reintroduce methods that are necessary to properly handle master/slave configuration Related to #15538303

from cubicweb.cwconfig import CubicWebConfiguration


def includeme(config):
    appid = config.registry.settings['cubicweb.instance']
    cwconfig = CubicWebConfiguration.config_for(appid)

    config.registry['cubicweb.config'] = cwconfig
    config.registry['cubicweb.repository'] = repo = cwconfig.repository()
    config.registry['cubicweb.registry'] = repo.vreg