--- a/server/repository.py Wed Sep 16 14:17:12 2009 +0200
+++ b/server/repository.py Wed Sep 16 14:24:31 2009 +0200
@@ -149,6 +149,7 @@
self._running_threads = []
# initial schema, should be build or replaced latter
self.schema = CubicWebSchema(config.appid)
+ self.vreg.schema = self.schema # until actual schema is loaded...
# querier helper, need to be created after sources initialization
self.querier = QuerierHelper(self, self.schema)
# should we reindex in changes?
@@ -192,7 +193,6 @@
config.bootstrap_cubes()
self.set_bootstrap_schema(config.load_schema())
# need to load the Any and CWUser entity types
- self.vreg.schema = self.schema
etdirectory = join(CW_SOFTWARE_ROOT, 'entities')
self.vreg.init_registration([etdirectory])
self.vreg.load_file(join(etdirectory, '__init__.py'),
@@ -246,15 +246,16 @@
if rebuildinfered:
schema.rebuild_infered_relations()
self.info('set schema %s %#x', schema.name, id(schema))
- self.debug(', '.join(sorted(str(e) for e in schema.entities())))
+ if resetvreg:
+ # full reload of all appobjects
+ self.vreg.reset()
+ self.vreg.set_schema(schema)
+ else:
+ self.vreg._set_schema(schema)
self.querier.set_schema(schema)
for source in self.sources:
source.set_schema(schema)
self.schema = schema
- if resetvreg:
- # full reload of all appobjects
- self.vreg.reset()
- self.vreg.set_schema(schema)
self.reset_hooks()
def reset_hooks(self):