server/repository.py
changeset 8539 d32ab8570e5d
parent 8538 00597256de18
child 8562 0d2fb4604265
equal deleted inserted replaced
8538:00597256de18 8539:d32ab8570e5d
   205             # will be reinitialized later from cubes found in the database
   205             # will be reinitialized later from cubes found in the database
   206             config._cubes = None
   206             config._cubes = None
   207         elif config.creating:
   207         elif config.creating:
   208             # repository creation
   208             # repository creation
   209             config.bootstrap_cubes()
   209             config.bootstrap_cubes()
   210             self.set_schema(config.load_schema(), resetvreg=False)
   210             # trigger vreg initialisation of entity classes
   211             # need to load the Any and CWUser entity types
   211             config.cubicweb_appobject_path = set(('hooks', 'entities'))
   212             etdirectory = join(CW_SOFTWARE_ROOT, 'entities')
   212             config.cube_appobject_path = set(('hooks', 'entities'))
   213             self.vreg.init_registration([etdirectory])
   213             self.set_schema(config.load_schema())
   214             for modname in ('__init__', 'authobjs', 'wfobjs'):
       
   215                 self.vreg.load_file(join(etdirectory, '%s.py' % modname),
       
   216                                     'cubicweb.entities.%s' % modname)
       
   217             hooksdirectory = join(CW_SOFTWARE_ROOT, 'hooks')
       
   218             self.vreg.load_file(join(hooksdirectory, 'metadata.py'),
       
   219                                 'cubicweb.hooks.metadata')
       
   220         elif config.read_instance_schema:
   214         elif config.read_instance_schema:
   221             # normal start: load the instance schema from the database
   215             # normal start: load the instance schema from the database
   222             self.fill_schema()
   216             self.fill_schema()
   223         else:
   217         else:
   224             # test start: use the file system schema (quicker)
   218             # test start: use the file system schema (quicker)