commit-gnue
[Top][All Lists]
Advanced

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

r6774 - trunk/gnue-appserver/src


From: johannes
Subject: r6774 - trunk/gnue-appserver/src
Date: Wed, 1 Dec 2004 08:18:13 -0600 (CST)

Author: johannes
Date: 2004-12-01 08:18:12 -0600 (Wed, 01 Dec 2004)
New Revision: 6774

Modified:
   trunk/gnue-appserver/src/geasInstance.py
Log:
Do it a bit cleaner ...


Modified: trunk/gnue-appserver/src/geasInstance.py
===================================================================
--- trunk/gnue-appserver/src/geasInstance.py    2004-12-01 14:03:35 UTC (rev 
6773)
+++ trunk/gnue-appserver/src/geasInstance.py    2004-12-01 14:18:12 UTC (rev 
6774)
@@ -199,25 +199,27 @@
     classdef = self.__classdef
     record   = self.__record
 
-    for e in elements [:-1]:
-      propertydef = classdef.properties [e]
-      if not propertydef.isReference:
-        raise ReferenceError, (propertyname, propertydef.fullName)
-      classdef = propertydef.referencedClass
-      key = record.getField (propertydef.column)
-      # if any reference on the way through the property name is None, assume
-      # the indirect property is None.
-      if key is None:
-        return None
-      record = self.__connection.findRecord (classdef.table, key, [])
+    if len (elements [:-1]):
+      for e in elements [:-1]:
+        propertydef = classdef.properties [e]
+        if not propertydef.isReference:
+          raise ReferenceError, (propertyname, propertydef.fullName)
+        classdef = propertydef.referencedClass
+        key = record.getField (propertydef.column)
+        # if any reference on the way through the property name is None, assume
+        # the indirect property is None.
+        if key is None:
+          return None
+        record = self.__connection.findRecord (classdef.table, key, [])
 
+      instance = geasInstance (self.__session, self.__connection, record,
+                               classdef)
+    else:
+      instance = self
+
     propertydef = classdef.properties [elements [-1]]
     if propertydef.isCalculated:
-      ref = self
-      if classdef.fullName != self.__classdef.fullName:
-        ref = geasInstance (self.__session, self.__connection, record, 
classdef)
-
-      value = ref.call (propertydef.procedure, None)
+      value = instance.call (propertydef.procedure, None)
     else:
       value = record.getField (propertydef.column)
 





reply via email to

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