1228 self.repo.hm.call_hooks('before_delete_entity', cnx, entity=entity) |
1228 self.repo.hm.call_hooks('before_delete_entity', cnx, entity=entity) |
1229 # remove is / is_instance_of which are added using sql by hooks, hence |
1229 # remove is / is_instance_of which are added using sql by hooks, hence |
1230 # unvisible as transaction action |
1230 # unvisible as transaction action |
1231 self.doexec(cnx, 'DELETE FROM is_relation WHERE eid_from=%s' % eid) |
1231 self.doexec(cnx, 'DELETE FROM is_relation WHERE eid_from=%s' % eid) |
1232 self.doexec(cnx, 'DELETE FROM is_instance_of_relation WHERE eid_from=%s' % eid) |
1232 self.doexec(cnx, 'DELETE FROM is_instance_of_relation WHERE eid_from=%s' % eid) |
1233 self.doexec(cnx, 'DELETE FROM cw_source_relation WHERE eid_from=%s' % self.eid) |
1233 self.doexec(cnx, 'DELETE FROM cw_source_relation WHERE eid_from=%s' % eid) |
1234 # XXX check removal of inlined relation? |
1234 # XXX check removal of inlined relation? |
1235 # delete the entity |
1235 # delete the entity |
1236 attrs = {'cw_eid': eid} |
1236 attrs = {'cw_eid': eid} |
1237 sql = self.sqlgen.delete(SQL_PREFIX + entity.cw_etype, attrs) |
1237 sql = self.sqlgen.delete(SQL_PREFIX + entity.cw_etype, attrs) |
1238 self.doexec(cnx, sql, attrs) |
1238 self.doexec(cnx, sql, attrs) |