pyramid_cubicweb/init_instance.py
author Christophe de Vienne <cdevienne@gmail.com>
Mon, 10 Aug 2015 17:42:47 +0200
changeset 11594 61f69ac2d6bc
parent 11492 b0b8942cdb80
permissions -rw-r--r--
[pkg] 0.5.0

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