equal
deleted
inserted
replaced
1034 # allocate an eid to the entity before calling hooks |
1034 # allocate an eid to the entity before calling hooks |
1035 entity.eid = self.system_source.create_eid(session) |
1035 entity.eid = self.system_source.create_eid(session) |
1036 # set caches asap |
1036 # set caches asap |
1037 extid = self.init_entity_caches(session, entity, source) |
1037 extid = self.init_entity_caches(session, entity, source) |
1038 if server.DEBUG & server.DBG_REPO: |
1038 if server.DEBUG & server.DBG_REPO: |
1039 print 'ADD entity', entity.__regid__, entity.eid, dict(entity) |
1039 print 'ADD entity', self, entity.__regid__, entity.eid, entity.cw_attr_cache |
1040 relations = [] |
1040 relations = [] |
1041 if source.should_call_hooks: |
1041 if source.should_call_hooks: |
1042 self.hm.call_hooks('before_add_entity', session, entity=entity) |
1042 self.hm.call_hooks('before_add_entity', session, entity=entity) |
1043 # XXX use entity.keys here since edited_attributes is not updated for |
1043 # XXX use entity.keys here since edited_attributes is not updated for |
1044 # inline relations XXX not true, right? (see edited_attributes |
1044 # inline relations XXX not true, right? (see edited_attributes |
1086 """replace an entity in the repository |
1086 """replace an entity in the repository |
1087 the type and the eid of an entity must not be changed |
1087 the type and the eid of an entity must not be changed |
1088 """ |
1088 """ |
1089 if server.DEBUG & server.DBG_REPO: |
1089 if server.DEBUG & server.DBG_REPO: |
1090 print 'UPDATE entity', entity.__regid__, entity.eid, \ |
1090 print 'UPDATE entity', entity.__regid__, entity.eid, \ |
1091 dict(entity), edited_attributes |
1091 entity.cw_attr_cache, edited_attributes |
1092 hm = self.hm |
1092 hm = self.hm |
1093 eschema = entity.e_schema |
1093 eschema = entity.e_schema |
1094 session.set_entity_cache(entity) |
1094 session.set_entity_cache(entity) |
1095 orig_edited_attributes = getattr(entity, 'edited_attributes', None) |
1095 orig_edited_attributes = getattr(entity, 'edited_attributes', None) |
1096 entity.edited_attributes = edited_attributes |
1096 entity.edited_attributes = edited_attributes |