cubicweb/server/repository.py
changeset 12240 8eb15566142f
parent 12148 79160d54662e
child 12508 a8c1ea390400
child 12747 36d4a8ec1fb7
equal deleted inserted replaced
12239:19aae64c4010 12240:8eb15566142f
   921         for rtype, eids_subj_obj in relations.items():
   921         for rtype, eids_subj_obj in relations.items():
   922             if server.DEBUG & server.DBG_REPO:
   922             if server.DEBUG & server.DBG_REPO:
   923                 for subjeid, objeid in eids_subj_obj:
   923                 for subjeid, objeid in eids_subj_obj:
   924                     print('ADD relation', subjeid, rtype, objeid)
   924                     print('ADD relation', subjeid, rtype, objeid)
   925             for subjeid, objeid in eids_subj_obj:
   925             for subjeid, objeid in eids_subj_obj:
   926                 if rtype in relations_by_rtype:
   926                 relations_by_rtype.setdefault(rtype, []).append((subjeid, objeid))
   927                     relations_by_rtype[rtype].append((subjeid, objeid))
       
   928                 else:
       
   929                     relations_by_rtype[rtype] = [(subjeid, objeid)]
       
   930                 if not activintegrity:
   927                 if not activintegrity:
   931                     continue
   928                     continue
   932                 # take care to relation of cardinality '?1', as all eids will
   929                 # take care to relation of cardinality '?1', as all eids will
   933                 # be inserted later, we've remove duplicated eids since they
   930                 # be inserted later, we've remove duplicated eids since they
   934                 # won't be caught by `del_existing_rel_if_needed`
   931                 # won't be caught by `del_existing_rel_if_needed`