server/sources/native.py
changeset 10000 4352b7ccde04
parent 9990 c84ad981fc4a
parent 9996 65bb21409292
child 10074 ab956b780d4e
equal deleted inserted replaced
9990:c84ad981fc4a 10000:4352b7ccde04
  1021             restr['txa_public'] = True
  1021             restr['txa_public'] = True
  1022         # XXX use generator to avoid loading everything in memory?
  1022         # XXX use generator to avoid loading everything in memory?
  1023         sql = self.sqlgen.select('tx_entity_actions', restr,
  1023         sql = self.sqlgen.select('tx_entity_actions', restr,
  1024                                  ('txa_action', 'txa_public', 'txa_order',
  1024                                  ('txa_action', 'txa_public', 'txa_order',
  1025                                   'etype', 'eid', 'changes'))
  1025                                   'etype', 'eid', 'changes'))
  1026         cu = self.doexec(cnx, sql, restr)
  1026         with cnx.ensure_cnx_set:
  1027         actions = [tx.EntityAction(a,p,o,et,e,c and loads(self.binary_to_str(c)))
  1027             cu = self.doexec(cnx, sql, restr)
  1028                    for a,p,o,et,e,c in cu.fetchall()]
  1028             actions = [tx.EntityAction(a,p,o,et,e,c and loads(self.binary_to_str(c)))
       
  1029                        for a,p,o,et,e,c in cu.fetchall()]
  1029         sql = self.sqlgen.select('tx_relation_actions', restr,
  1030         sql = self.sqlgen.select('tx_relation_actions', restr,
  1030                                  ('txa_action', 'txa_public', 'txa_order',
  1031                                  ('txa_action', 'txa_public', 'txa_order',
  1031                                   'rtype', 'eid_from', 'eid_to'))
  1032                                   'rtype', 'eid_from', 'eid_to'))
  1032         cu = self.doexec(cnx, sql, restr)
  1033         with cnx.ensure_cnx_set:
  1033         actions += [tx.RelationAction(*args) for args in cu.fetchall()]
  1034             cu = self.doexec(cnx, sql, restr)
       
  1035             actions += [tx.RelationAction(*args) for args in cu.fetchall()]
  1034         return sorted(actions, key=lambda x: x.order)
  1036         return sorted(actions, key=lambda x: x.order)
  1035 
  1037 
  1036     def undo_transaction(self, cnx, txuuid):
  1038     def undo_transaction(self, cnx, txuuid):
  1037         """See :class:`cubicweb.repoapi.ClientConnection.undo_transaction`
  1039         """See :class:`cubicweb.repoapi.ClientConnection.undo_transaction`
  1038 
  1040