cubicweb/pyramid/init_instance.py
author Yann Voté <yann.vote@logilab.fr>
Mon, 26 Sep 2016 14:52:12 +0200
changeset 11631 faf279e33298
parent 11492 pyramid_cubicweb/init_instance.py@b0b8942cdb80
permissions -rw-r--r--
Merge with pyramid-cubicweb The following tasks have been done: - merge packaging files - merge documentation - move pyramid_cubicweb package at cubicweb/pyramid and update imports accordingly - rename tests directory into test - move pyramid-cubicweb README.rst into README.pyramid.rst until better idea - add a test dependency on unreleased cubicweb-pyramid to have both py27 and py34 tests pass Closes #14023058.

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