server/sources/native.py
changeset 10662 10942ed172de
parent 10651 9ca33768473c
child 10676 9d6b79081bad
equal deleted inserted replaced
10661:e6eb0c7c2e98 10662:10942ed172de
   672                 etype = cnx.entity_metas(subject)['type']
   672                 etype = cnx.entity_metas(subject)['type']
   673                 if etype in etypes:
   673                 if etype in etypes:
   674                     etypes[etype].append((subject, object))
   674                     etypes[etype].append((subject, object))
   675                 else:
   675                 else:
   676                     etypes[etype] = [(subject, object)]
   676                     etypes[etype] = [(subject, object)]
   677             for subj_etype, subj_obj_list in etypes.iteritems():
   677             for subj_etype, subj_obj_list in etypes.items():
   678                 attrs = [{'cw_eid': subject, SQL_PREFIX + rtype: object}
   678                 attrs = [{'cw_eid': subject, SQL_PREFIX + rtype: object}
   679                          for subject, object in subj_obj_list]
   679                          for subject, object in subj_obj_list]
   680                 sql.append((self.sqlgen.update(SQL_PREFIX + etype, attrs[0],
   680                 sql.append((self.sqlgen.update(SQL_PREFIX + etype, attrs[0],
   681                                      ['cw_eid']),
   681                                      ['cw_eid']),
   682                             attrs))
   682                             attrs))
   974             # unless public explicitly set to false, we only consider public
   974             # unless public explicitly set to false, we only consider public
   975             # actions
   975             # actions
   976             if actionfilters.pop('public', True):
   976             if actionfilters.pop('public', True):
   977                 genrestr['txa_public'] = True
   977                 genrestr['txa_public'] = True
   978             # put additional filters in trarestr and/or tearestr
   978             # put additional filters in trarestr and/or tearestr
   979             for key, val in actionfilters.iteritems():
   979             for key, val in actionfilters.items():
   980                 if key == 'etype':
   980                 if key == 'etype':
   981                     # filtering on etype implies filtering on entity actions
   981                     # filtering on etype implies filtering on entity actions
   982                     # only, and with no eid specified
   982                     # only, and with no eid specified
   983                     assert actionfilters.get('action', 'C') in 'CUD'
   983                     assert actionfilters.get('action', 'C') in 'CUD'
   984                     assert not 'eid' in actionfilters
   984                     assert not 'eid' in actionfilters