server/repository.py
branchstable
changeset 9731 027bfc467a46
parent 9272 68744f5154c4
child 9769 d3f8866a48f5
equal deleted inserted replaced
9678:c34f0cee89b7 9731:027bfc467a46
  1450                         hm.call_hooks('after_delete_relation', session,
  1450                         hm.call_hooks('after_delete_relation', session,
  1451                                       eidfrom=entity.eid, rtype=attr, eidto=prevvalue)
  1451                                       eidfrom=entity.eid, rtype=attr, eidto=prevvalue)
  1452                         if relcache is not None:
  1452                         if relcache is not None:
  1453                             session.update_rel_cache_del(entity.eid, attr, prevvalue)
  1453                             session.update_rel_cache_del(entity.eid, attr, prevvalue)
  1454                     del_existing_rel_if_needed(session, entity.eid, attr, value)
  1454                     del_existing_rel_if_needed(session, entity.eid, attr, value)
  1455                     if relcache is not None:
  1455                     session.update_rel_cache_add(entity.eid, attr, value)
  1456                         session.update_rel_cache_add(entity.eid, attr, value)
       
  1457                     else:
       
  1458                         entity.cw_set_relation_cache(attr, 'subject',
       
  1459                                                      session.eid_rset(value))
       
  1460                     hm.call_hooks('after_add_relation', session,
  1456                     hm.call_hooks('after_add_relation', session,
  1461                                   eidfrom=entity.eid, rtype=attr, eidto=value)
  1457                                   eidfrom=entity.eid, rtype=attr, eidto=value)
  1462         finally:
  1458         finally:
  1463             if orig_edited is not None:
  1459             if orig_edited is not None:
  1464                 entity.cw_edited = orig_edited
  1460                 entity.cw_edited = orig_edited