commit-gnue
[Top][All Lists]
Advanced

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

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


From: johannes
Subject: [gnue] r7234 - trunk/gnue-appserver/src
Date: Sun, 20 Mar 2005 08:22:01 -0600 (CST)

Author: johannes
Date: 2005-03-20 08:22:00 -0600 (Sun, 20 Mar 2005)
New Revision: 7234

Modified:
   trunk/gnue-appserver/src/data.py
Log:
Added exception class, fixed comment


Modified: trunk/gnue-appserver/src/data.py
===================================================================
--- trunk/gnue-appserver/src/data.py    2005-03-20 14:08:13 UTC (rev 7233)
+++ trunk/gnue-appserver/src/data.py    2005-03-20 14:22:00 UTC (rev 7234)
@@ -48,6 +48,11 @@
 class OrderBySequenceError (errors.ApplicationError):
   pass
 
+class CircularReferenceError (errors.ApplicationError):
+  def __init__ (self):
+    msg = u_("Data contains circular references")
+    errors.ApplicationError.__init__ (self, msg)
+
 # =============================================================================
 # Cache class
 # =============================================================================
@@ -895,14 +900,15 @@
     tables = {}
     data   = {}
 
-    # First create a dictionary with all tables scheduled for processing
+    # 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:
-
       tables [table] = []
+      
       rows = data.setdefault (table, [])
       rows.append ((table, row))
 
-    # Now, add all those constraints which are also scheduled for insertion.
+    # Now, add all those constraints which are also scheduled for processing.
     # This eliminates constraints which are currently NULL.
     for (table, deps) in tables.items ():
       if self.__constraints.has_key (table):
@@ -932,7 +938,7 @@
       # If no tables without a dependency was found, but there are still
       # entries in the tables dictionary, they *must* have circular references
       if not len (addition) and len (tables):
-        raise CircularReferencesError
+        raise CircularReferenceError
 
       order.extend (addition)
 





reply via email to

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