commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r7238 - trunk/gnue-appserver/src


From: johannes
Subject: [gnue] r7238 - trunk/gnue-appserver/src
Date: Mon, 21 Mar 2005 05:07:42 -0600 (CST)

Author: johannes
Date: 2005-03-21 05:07:41 -0600 (Mon, 21 Mar 2005)
New Revision: 7238

Modified:
   trunk/gnue-appserver/src/data.py
Log:
Added (temporary) debug-output


Modified: trunk/gnue-appserver/src/data.py
===================================================================
--- trunk/gnue-appserver/src/data.py    2005-03-21 00:12:46 UTC (rev 7237)
+++ trunk/gnue-appserver/src/data.py    2005-03-21 11:07:41 UTC (rev 7238)
@@ -104,14 +104,9 @@
     else:
       tables = self.__old
 
-    if not tables.has_key (table):
-      tables [table] = {}
-    rows = tables [table]
+    rows   = tables.setdefault (table, {})
+    fields = rows.setdefault (row, {})
 
-    if not rows.has_key (row):
-      rows [row] = {}
-    fields = rows [row]
-
     fields [field] = value
 
     # Update state information of the row
@@ -150,9 +145,9 @@
     checktype (field, UnicodeType)
 
     if dirty is None:
-      # We could use self.__has (), here but avoiding an additional function
+      # We could use self.__has () here, but avoiding an additional function
       # call here is a big deal regarding performance, as this function is
-      # called about 100000 times for a (quite small) class-repository
+      # called very often
       return (self.__old.has_key (table) and self.__old [table].has_key (row) \
               and self.__old [table][row].has_key (field)) or \
              (self.__new.has_key (table) and self.__new [table].has_key (row) \
@@ -861,9 +856,12 @@
 
     records = [(table, row) for (table, row) in self.__inserted \
                              if self.__cache.status (table, row) == 'inserted']
-    return self.__orderByDependency (records)
+    result = self.__orderByDependency (records)
+    gDebug (1, "Ordered inserts: %s" % result)
 
+    return result
 
+
   # ---------------------------------------------------------------------------
   # Order all records scheduled for deletion
   # ---------------------------------------------------------------------------
@@ -900,6 +898,9 @@
     tables = {}
     data   = {}
 
+    gDebug (1, "Constraints: %s" % self.__constraints)
+    gDebug (1, "Unordered  : %s" % records)
+
     # First create a dictionary with all tables scheduled for processing, and
     # another dictionary of all records grouped by their tablename
     for (table, row) in records:





reply via email to

[Prev in Thread] Current Thread [Next in Thread]