# HG changeset patch # User Sylvain Thénault # Date 1246609522 -7200 # Node ID bc6fc4d6bcacf05599099b92dc75f3b577fdce67 # Parent cbf043a2134a3cb7065a6981ab8b716a7693c886 fix for schema/eid index diff -r cbf043a2134a -r bc6fc4d6bcac server/schemahooks.py --- a/server/schemahooks.py Thu Jul 02 15:02:24 2009 +0200 +++ b/server/schemahooks.py Fri Jul 03 10:25:22 2009 +0200 @@ -247,8 +247,7 @@ """actually add the entity type to the application's schema""" eid = None # make pylint happy def commit_event(self): - eschema = self.schema.add_entity_type(self.kobj) - eschema.eid = self.eid + self.schema.add_entity_type(self.kobj) def before_add_eetype(session, entity): """before adding a CWEType entity: @@ -299,7 +298,8 @@ # register operation to modify the schema on commit # this have to be done before adding other relations definitions # or permission settings - AddCWETypeOp(session, etype, eid=entity.eid) + etype.eid = entity.eid + AddCWETypeOp(session, etype) # add meta creation_date, modification_date and owned_by relations for rql, kwargs in relrqls: session.execute(rql, kwargs) @@ -311,7 +311,6 @@ def commit_event(self): rschema = self.schema.add_relation_type(self.kobj) rschema.set_default_groups() - rschema.eid = self.eid def before_add_ertype(session, entity): """before adding a CWRType entity: @@ -331,12 +330,13 @@ schema on commit We don't know yeat this point if a table is necessary """ - AddCWRTypeOp(session, RelationType(name=entity['name'], - description=entity.get('description'), - meta=entity.get('meta', False), - inlined=entity.get('inlined', False), - symetric=entity.get('symetric', False)), - eid=entity.eid) + rtype = RelationType(name=entity['name'], + description=entity.get('description'), + meta=entity.get('meta', False), + inlined=entity.get('inlined', False), + symetric=entity.get('symetric', False)) + rtype.eid = entity.eid + AddCWRTypeOp(session, rtype) class AddErdefOp(EarlySchemaOperation):