commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r10218 - in trunk/gnue-common: . src/datasources/drivers/Base


From: reinhard
Subject: [gnue] r10218 - in trunk/gnue-common: . src/datasources/drivers/Base
Date: Thu, 28 Oct 2010 13:52:03 -0500 (CDT)

Author: reinhard
Date: 2010-10-28 13:52:02 -0500 (Thu, 28 Oct 2010)
New Revision: 10218

Modified:
   trunk/gnue-common/
   trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
Log:
If there is no current record, jump to the first record on nextRecord() and to
the last record on prevRecord().



Property changes on: trunk/gnue-common
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2010-10-20 22:35:25.994999886 +0200
committer: Reinhard Müller <address@hidden>
properties: 
        branch-nick: common

   + timestamp: 2010-10-28 17:08:44.424000025 +0200
committer: Reinhard Müller <address@hidden>
properties: 
        branch-nick: common

Name: bzr:revision-id:v4
   - 3116 address@hidden
3117 address@hidden
3118 address@hidden
3119 address@hidden
3120 address@hidden
3121 address@hidden
3122 address@hidden
3123 address@hidden
3124 address@hidden
3125 address@hidden
3126 address@hidden
3127 address@hidden
3128 address@hidden
3129 address@hidden
3130 address@hidden
3131 address@hidden
3132 address@hidden
3133 address@hidden

   + 3116 address@hidden
3117 address@hidden
3118 address@hidden
3119 address@hidden
3120 address@hidden
3121 address@hidden
3122 address@hidden
3123 address@hidden
3124 address@hidden
3125 address@hidden
3126 address@hidden
3127 address@hidden
3128 address@hidden
3129 address@hidden
3130 address@hidden
3131 address@hidden
3132 address@hidden
3133 address@hidden
3134 address@hidden


Modified: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2010-10-20 
20:35:55 UTC (rev 10217)
+++ trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2010-10-28 
18:52:02 UTC (rev 10218)
@@ -413,11 +413,12 @@
         @return: the new current record as a L{RecordSet.RecordSet} instance,
             or None if the cursor already pointed to the first record.
         """
-        if self.__current_index < 1:
+        if self.__current_index < 0:
+            return self.lastRecord()
+        if self.__current_index == 0:
             return None
-        else:
-            self.__move(self.__current_index - 1)
-            return self.current
+        self.__move(self.__current_index - 1)
+        return self.current
 
     # -------------------------------------------------------------------------
 
@@ -433,6 +434,8 @@
             fetching it from the backend fails. The exact exception class
             depends on the backend.
         """
+        if self.__current_index < 0:
+            return self.firstRecord()
         if self.__current_index + 1 == len(self.__cached_records):
             if not self.__cache_next_record():
                 return None




reply via email to

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