cubicweb/pyramid/init_instance.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 24 Nov 2016 15:39:52 +0100
changeset 11867 c714e55fbce1
parent 11631 faf279e33298
permissions -rw-r--r--
[cwctl] Kill deprecated ordered_instances method no need to keep bw compat for this.

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