equal
deleted
inserted
replaced
1001 the entity instance |
1001 the entity instance |
1002 """ |
1002 """ |
1003 # init edited_attributes before calling before_add_entity hooks |
1003 # init edited_attributes before calling before_add_entity hooks |
1004 entity._is_saved = False # entity has an eid but is not yet saved |
1004 entity._is_saved = False # entity has an eid but is not yet saved |
1005 entity.edited_attributes = set(entity) |
1005 entity.edited_attributes = set(entity) |
1006 entity = entity.pre_add_hook() |
1006 entity_ = entity.pre_add_hook() |
|
1007 # XXX kill that transmutation feature ! |
|
1008 if not entity_ is entity: |
|
1009 entity.__class__ = entity_.__class__ |
|
1010 entity.__dict__.update(entity_.__dict__) |
1007 eschema = entity.e_schema |
1011 eschema = entity.e_schema |
1008 etype = str(eschema) |
1012 etype = str(eschema) |
1009 source = self.locate_etype_source(etype) |
1013 source = self.locate_etype_source(etype) |
1010 # attribute an eid to the entity before calling hooks |
1014 # attribute an eid to the entity before calling hooks |
1011 entity.set_eid(self.system_source.create_eid(session)) |
1015 entity.set_eid(self.system_source.create_eid(session)) |