initialize entity classes in repository initialization stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 16 Oct 2009 14:15:44 +0200
branchstable
changeset 3699 20ba545e00e1
parent 3694 33dbb1da1db9
child 3700 fd550e4dc515
initialize entity classes in repository initialization
server/__init__.py
--- a/server/__init__.py	Thu Oct 15 20:31:55 2009 +0200
+++ b/server/__init__.py	Fri Oct 16 14:15:44 2009 +0200
@@ -176,6 +176,10 @@
     # reloging using the admin user
     config._cubes = None # avoid assertion error
     repo, cnx = in_memory_cnx(config, login, pwd)
+    # trigger vreg initialisation of entity classes
+    config.cubicweb_appobject_path = set(('entities',))
+    config.cube_appobject_path = set(('entities',))
+    repo.vreg.set_schema(repo.schema)
     assert len(repo.sources) == 1, repo.sources
     handler = config.migration_handler(schema, interactive=False,
                                        cnx=cnx, repo=repo)