on entity deletion query, return eids of deleted entities
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 13 Oct 2009 08:50:51 +0200
changeset 3648 665c37544060
parent 3647 2941f4a0aab9
child 3649 59eb710b9862
on entity deletion query, return eids of deleted entities
server/ssplanner.py
server/test/unittest_querier.py
--- a/server/ssplanner.py	Tue Oct 13 08:50:19 2009 +0200
+++ b/server/ssplanner.py	Tue Oct 13 08:50:51 2009 +0200
@@ -376,6 +376,7 @@
 
     def execute(self):
         """execute this step"""
+        results = self.execute_child()
         todelete = frozenset(typed_eid(eid) for eid, in self.execute_child())
         session = self.plan.session
         delete = session.repo.glob_delete_entity
@@ -385,7 +386,7 @@
         pending |= actual
         for eid in actual:
             delete(session, eid)
-
+        return results
 
 class DeleteRelationsStep(Step):
     """step consisting in deleting relations"""
--- a/server/test/unittest_querier.py	Tue Oct 13 08:50:19 2009 +0200
+++ b/server/test/unittest_querier.py	Tue Oct 13 08:50:51 2009 +0200
@@ -907,7 +907,8 @@
         self.execute("INSERT Personne Y: Y nom 'toto'")
         rset = self.execute('Personne X WHERE X nom "toto"')
         self.assertEqual(len(rset.rows), 1)
-        self.execute("DELETE Personne Y WHERE Y nom 'toto'")
+        drset = self.execute("DELETE Personne Y WHERE Y nom 'toto'")
+        self.assertEqual(drset.rows, rset.rows)
         rset = self.execute('Personne X WHERE X nom "toto"')
         self.assertEqual(len(rset.rows), 0)