cubicweb/pyramid/init_instance.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 08 Nov 2016 18:34:22 +0100
branch3.24
changeset 11807 9d478b81f6d7
parent 11631 faf279e33298
permissions -rw-r--r--
[hooks] Delete some properties cached on entities schema on schema updates cubicweb.schema add two additional @cachedproperty that should be cleared when in-memory schema is modified. This may leads to e.g. attempt to delete some already dropped relations. Related to #16130960

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