cubicweb/pyramid/init_instance.py
author Denis Laxalde <denis.laxalde@logilab.fr>
Fri, 10 Feb 2017 17:13:44 +0100
changeset 11967 83739be20fab
parent 11631 faf279e33298
permissions -rw-r--r--
[pyramid] Add a copyright and docstring to all modules We add copyright statements for both UNLISH (original author) and LOGILAB.

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