cubicweb/server/sources/native.py
changeset 11429 6a9a9ea1e9b9
parent 11417 5e5e224239c3
child 11430 1ea5ba74a13c
equal deleted inserted replaced
11428:7995ae2d74be 11429:6a9a9ea1e9b9
  1046             restr['txa_public'] = True
  1046             restr['txa_public'] = True
  1047         # XXX use generator to avoid loading everything in memory?
  1047         # XXX use generator to avoid loading everything in memory?
  1048         sql = self.sqlgen.select('tx_entity_actions', restr,
  1048         sql = self.sqlgen.select('tx_entity_actions', restr,
  1049                                  ('txa_action', 'txa_public', 'txa_order',
  1049                                  ('txa_action', 'txa_public', 'txa_order',
  1050                                   'etype', 'eid', 'changes'))
  1050                                   'etype', 'eid', 'changes'))
  1051         with cnx.ensure_cnx_set:
  1051         cu = self.doexec(cnx, sql, restr)
  1052             cu = self.doexec(cnx, sql, restr)
  1052         actions = [tx.EntityAction(a, p, o, et, e, c and pickle.loads(self.binary_to_str(c)))
  1053             actions = [tx.EntityAction(a, p, o, et, e, c and pickle.loads(self.binary_to_str(c)))
  1053                    for a, p, o, et, e, c in cu.fetchall()]
  1054                        for a, p, o, et, e, c in cu.fetchall()]
       
  1055         sql = self.sqlgen.select('tx_relation_actions', restr,
  1054         sql = self.sqlgen.select('tx_relation_actions', restr,
  1056                                  ('txa_action', 'txa_public', 'txa_order',
  1055                                  ('txa_action', 'txa_public', 'txa_order',
  1057                                   'rtype', 'eid_from', 'eid_to'))
  1056                                   'rtype', 'eid_from', 'eid_to'))
  1058         with cnx.ensure_cnx_set:
  1057         cu = self.doexec(cnx, sql, restr)
  1059             cu = self.doexec(cnx, sql, restr)
  1058         actions += [tx.RelationAction(*args) for args in cu.fetchall()]
  1060             actions += [tx.RelationAction(*args) for args in cu.fetchall()]
       
  1061         return sorted(actions, key=lambda x: x.order)
  1059         return sorted(actions, key=lambda x: x.order)
  1062 
  1060 
  1063     def undo_transaction(self, cnx, txuuid):
  1061     def undo_transaction(self, cnx, txuuid):
  1064         """See :class:`cubicweb.repoapi.Connection.undo_transaction`
  1062         """See :class:`cubicweb.repoapi.Connection.undo_transaction`
  1065 
  1063