commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r9247 - in trunk/gnue-forms/src: . GFObjects


From: reinhard
Subject: [gnue] r9247 - in trunk/gnue-forms/src: . GFObjects
Date: Tue, 9 Jan 2007 14:53:38 -0600 (CST)

Author: reinhard
Date: 2007-01-09 14:53:37 -0600 (Tue, 09 Jan 2007)
New Revision: 9247

Modified:
   trunk/gnue-forms/src/GFForm.py
   trunk/gnue-forms/src/GFObjects/GFBlock.py
   trunk/gnue-forms/src/GFObjects/GFField.py
Log:
Replaced is_empty() by more generally usable get_record_status().


Modified: trunk/gnue-forms/src/GFForm.py
===================================================================
--- trunk/gnue-forms/src/GFForm.py      2007-01-09 20:36:17 UTC (rev 9246)
+++ trunk/gnue-forms/src/GFForm.py      2007-01-09 20:53:37 UTC (rev 9247)
@@ -813,7 +813,7 @@
         if currentBlock is None or ( \
             currentBlock.transparent and not ( \
               currentBlock.autoNextRecord and not ( \
-                  currentBlock.is_empty() or \
+                  currentBlock.get_record_status() in [None, 'empty'] or \
                   (not reverse and currentBlock.is_last_record() and \
                        not (currentBlock.autoCreate and \
                             currentBlock.editable in ('Y', 'new')) or \
@@ -866,7 +866,7 @@
             self.change_focus(nextEntry, -1)
           elif currentBlock is not None and not reverse and \
              currentBlock.autoNextRecord and \
-             not currentBlock.is_empty() and \
+             not currentBlock.get_record_status() in [None, 'empty'] and \
              not (not currentBlock.autoCreate and \
                   currentBlock.is_last_record()):
                self.change_focus(nextEntry, +1)
@@ -1030,7 +1030,7 @@
         if self._currentBlock is not None:
             if self._currentBlock.mode == 'query':
                 return 'query'
-            elif self._currentBlock.is_empty():
+            elif self._currentBlock.get_record_status() in [None, 'empty']:
                 return 'new'
             else:
                 return 'edit'
@@ -1397,7 +1397,7 @@
                 raise
 
         finally:
-            if self._currentBlock.is_empty ():
+            if self._currentBlock.get_record_status() == 'empty':
                 self.status_message (u_('Query returned no results.'))
             else:
                 self.status_message (u_('Query successful.'))

Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFBlock.py   2007-01-09 20:36:17 UTC (rev 
9246)
+++ trunk/gnue-forms/src/GFObjects/GFBlock.py   2007-01-09 20:53:37 UTC (rev 
9247)
@@ -722,7 +722,7 @@
             return
 
         if self.__resultset.isLastRecord():
-            if self.autoCreate and not self.is_empty() and \
+            if self.autoCreate and self.get_record_status() != 'empty' and \
                     not self.editable in('update', 'N'):
                 self.new_record()
             return
@@ -920,8 +920,7 @@
         """
 
         assert gDebug(1, "DEPRECATED: <block>.isEmpty trigger function")
-        return self.__resultset is None or self.__resultset.current is None \
-                or self.__resultset.current.isEmpty()
+        return self.get_record_status() in [None, 'empty']
 
     # -------------------------------------------------------------------------
 

Modified: trunk/gnue-forms/src/GFObjects/GFField.py
===================================================================
--- trunk/gnue-forms/src/GFObjects/GFField.py   2007-01-09 20:36:17 UTC (rev 
9246)
+++ trunk/gnue-forms/src/GFObjects/GFField.py   2007-01-09 20:53:37 UTC (rev 
9247)
@@ -391,9 +391,10 @@
         # Auto-query support     
         if self._block.mode != 'query' \
                 and ((self.autoquery == 'Y') \
-                    or (self.autoquery == 'new' and self._block.is_empty())):
+                    or (self.autoquery == 'new' \
+                        and self._block.get_record_status() == 'empty')):
             self._block.query({self.field: value})
-            if self._block.is_empty():
+            if self._block.get_record_status() == 'empty':
                 # Query returned no result, so set the field value
                 self._block.set_value(self, value)
         else:





reply via email to

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