cubicweb/pyramid/init_instance.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 14 Dec 2016 17:04:29 +0100
branch3.24
changeset 11893 b230f4a4010d
parent 11631 faf279e33298
permissions -rw-r--r--
Extract functions to list expected/found database indexes from check_indexes so they may be used from other contexts. Use consistent naming along the way: always use indexes, not indices.

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