552 esubpath = subpath |
552 esubpath = subpath |
553 if 'views' in subpath: |
553 if 'views' in subpath: |
554 esubpath = list(subpath) |
554 esubpath = list(subpath) |
555 esubpath.remove('views') |
555 esubpath.remove('views') |
556 esubpath.append(join('web', 'views')) |
556 esubpath.append(join('web', 'views')) |
557 cubes = reversed([config.cube_dir(p) for p in cubes]) |
557 cubespath = [config.cube_dir(p) for p in cubes] |
558 vpath = config.build_vregistry_path(cubes, evobjpath=esubpath, |
558 config.load_site_cubicweb(cubespath) |
|
559 vpath = config.build_vregistry_path(reversed(cubespath), |
|
560 evobjpath=esubpath, |
559 tvobjpath=subpath) |
561 tvobjpath=subpath) |
560 self.vreg.register_objects(vpath) |
562 self.vreg.register_objects(vpath) |
561 if self._cnxtype == 'inmemory': |
|
562 # should reinit hooks manager as well |
|
563 hm, config = self._repo.hm, self._repo.config |
|
564 hm.set_schema(hm.schema) # reset structure |
|
565 hm.register_system_hooks(config) |
|
566 # instance specific hooks |
|
567 if self._repo.config.instance_hooks: |
|
568 hm.register_hooks(config.load_hooks(self.vreg)) |
|
569 |
563 |
570 def use_web_compatible_requests(self, baseurl, sitetitle=None): |
564 def use_web_compatible_requests(self, baseurl, sitetitle=None): |
571 """monkey patch DBAPIRequest to fake a cw.web.request, so you should |
565 """monkey patch DBAPIRequest to fake a cw.web.request, so you should |
572 able to call html views using rset from a simple dbapi connection. |
566 able to call html views using rset from a simple dbapi connection. |
573 |
567 |