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