commit-gnue
[Top][All Lists]
Advanced

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

r6658 - trunk/gnue-appserver/src


From: johannes
Subject: r6658 - trunk/gnue-appserver/src
Date: Tue, 9 Nov 2004 02:23:12 -0600 (CST)

Author: johannes
Date: 2004-11-09 02:23:12 -0600 (Tue, 09 Nov 2004)
New Revision: 6658

Modified:
   trunk/gnue-appserver/src/geasInstance.py
Log:
Call OnValidate () triggers *before* checking required properties


Modified: trunk/gnue-appserver/src/geasInstance.py
===================================================================
--- trunk/gnue-appserver/src/geasInstance.py    2004-11-09 08:10:00 UTC (rev 
6657)
+++ trunk/gnue-appserver/src/geasInstance.py    2004-11-09 08:23:12 UTC (rev 
6658)
@@ -341,13 +341,8 @@
     value other than None. If a none value is encountered a PropertyValueError
     is raised.
     """
-    for prop in self.__classdef.properties.values ():
-      if not prop.isCalculated:
-        if prop.gnue_nullable is not None and not prop.gnue_nullable:
-          value = self.__record.getField (prop.column)
-          if value is None:
-            raise PropertyValueError, (prop.fullName, None)
 
+    # First get all validation procedures of the class
     ownValidate = None
     triggers    = []
     for proc in self.__classdef.procedures.values ():
@@ -357,13 +352,22 @@
         else:
           triggers.append (proc)
 
+    # now call all triggers
     for proc in triggers:
       self.call (proc, None)
 
     if ownValidate is not None:
       self.call (ownValidate, None)
     
+    # after finishing all OnValidate calls, have a look at the required fields
+    for prop in self.__classdef.properties.values ():
+      if not prop.isCalculated:
+        if prop.gnue_nullable is not None and not prop.gnue_nullable:
+          value = self.__record.getField (prop.column)
+          if value is None:
+            raise PropertyValueError, (prop.fullName, None)
 
+
   # ---------------------------------------------------------------------------
   # Dictionary-like access methods
   # ---------------------------------------------------------------------------





reply via email to

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