dabo Commit
Revision 1592
Date: 2005-11-28 12:01:05 -0800 (Mon, 28 Nov 2005)
Author: paul

Changed:
U   trunk/dabo/biz/dBizobj.py

Log:
Had to add some code to dBizobj's __getattr__ to not try to create the cursor
if it doesn't exist yet, with the new changes to eventMixin.


Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py   2005-11-28 18:18:45 UTC (rev 1591)
+++ trunk/dabo/biz/dBizobj.py   2005-11-28 20:01:05 UTC (rev 1592)
@@ -110,15 +110,18 @@
                If there is no object attribute named 'att', and no field in 
the cursor by that
                name, an AttributeError is raised.
                """
-               if self.useFieldProps:
-                       err = False
-                       try:
-                               ret = self.getFieldVal(att)
-                       except (dException.dException, 
dException.NoRecordsException):
-                               err = True
-                       if err == True:
-                               raise AttributeError, " '%s' object has no 
attribute '%s' " % (self.__class__.__name__, att)
-                       return ret
+               err = False
+               if len(self.__cursors) > 0:
+                       if self.useFieldProps:
+                               try:
+                                       ret = self.getFieldVal(att)
+                               except (dException.dException, 
dException.NoRecordsException):
+                                       err = True
+               else:
+                       err = True
+               if err:
+                       raise AttributeError, " '%s' object has no attribute 
'%s' " % (self.__class__.__name__, att)
+               return ret
 
 
        def __setattr__(self, att, val):




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to