Re: slooow delete

Sebastien Bigaret <[email protected]> 05 Mar 2005 16:42:51 +0100
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
John Lenton <[email protected]> wrote:
> I'm guessing you forgot the patch?

  That's right!  Here it is:


Index: Modeling/EditingContext.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/EditingContext.py,v
retrieving revision 1.34
diff -u -r1.34 EditingContext.py
--- Modeling/EditingContext.py  20 Jul 2004 06:21:37 -0000      1.34
+++ Modeling/EditingContext.py  5 Mar 2005 15:41:26 -0000
@@ -351,6 +351,23 @@
 
     # Registering for notifications __TBD
     
+  def currentStateSummary(self):
+    """
+    Returns some informations about the EditingContext, such as the number of
+    objects it holds, the number of inserted objects, etc.
+    """
+    info={}
+    import time
+    info['time'] = time.time()
+    info['nb_objects'] = len(self._uniquingTable.globalIDs())
+    info['inserted'] = len(self._insertedObjects)
+    info['updated' ] = len(self._updatedObjects)
+    info['deleted' ] = len(self._deletedObjects)
+    info['pending_inserted'] = len(self._pendingInsertedObjects)
+    info['pending_updated' ] = len(self._pendingUpdatedObjects)
+    info['pending_deleted' ] = len(self._pendingDeletedObjects)
+    info['auto_insertion'] = self._propagatesInsertionForRelatedObjects
+    return info
   
   # Changes within the editing context
   def allDeletedGlobalIDs(self):



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click