pyramid_cubicweb/init_instance.py
author Denis Laxalde <denis.laxalde@logilab.fr>
Wed, 25 Nov 2015 13:39:53 +0100
changeset 11602 0737f481b358
parent 11492 b0b8942cdb80
permissions -rw-r--r--
Add a tox configuration

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