Author: reinhard
Date: 2010-10-20 15:35:55 -0500 (Wed, 20 Oct 2010)
New Revision: 10217

Modified:
   trunk/gnue-common/
   trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
Log:
If a new record is inserted into a result set with no current record, insert
the new record at the end.



Property changes on: trunk/gnue-common
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2010-10-20 21:55:35.084000111 +0200
committer: Reinhard Müller <reinhard.muel...@bytewise.at>
properties: 
        branch-nick: common

   + timestamp: 2010-10-20 22:35:25.994999886 +0200
committer: Reinhard Müller <reinhard.muel...@bytewise.at>
properties: 
        branch-nick: common

Name: bzr:revision-id:v4
   - 3116 reinhard.muel...@bytewise.at-20100426083315-ccfwx2pihuvqn60z
3117 reinhard.muel...@bytewise.at-20100503114756-unpxm52de0towufo
3118 reinhard.muel...@bytewise.at-20100503115129-uvondrz5bvkqubyv
3119 reinhard.muel...@bytewise.at-20100505081835-9peco6k7a2le0mvg
3120 reinhard.muel...@bytewise.at-20100505084742-wn5vtc4a129z8g28
3121 reinhard.muel...@bytewise.at-20100505092131-m2avvsci5w6aj0rv
3122 reinhard.muel...@bytewise.at-20100519151545-pybk8q2s234vzsf2
3123 reinhard.muel...@bytewise.at-20100525101023-xs7k6pkghh9t6fc3
3124 reinhard.muel...@bytewise.at-20100525114015-rj7eb0xdheqkcuql
3125 reinhard.muel...@bytewise.at-20100525145035-j177jbvu10me4mfp
3126 reinhard.muel...@bytewise.at-20100526111738-ic0wot9z1ulg2y1a
3127 reinhard.muel...@bytewise.at-20100612121357-1nf23tuj1tveh1lv
3128 reinhard.muel...@bytewise.at-20100929190642-6pp6cwlicgt2bhhs
3129 reinhard.muel...@bytewise.at-20100929190817-bje4kkvrjrpanut1
3130 reinhard.muel...@bytewise.at-20101016191602-kceb6hdjytt4im93
3131 reinhard.muel...@bytewise.at-20101020175112-o65lqy8lejjrvzaz
3132 reinhard.muel...@bytewise.at-20101020195535-gb2bt2h80mu5j5h4

   + 3116 reinhard.muel...@bytewise.at-20100426083315-ccfwx2pihuvqn60z
3117 reinhard.muel...@bytewise.at-20100503114756-unpxm52de0towufo
3118 reinhard.muel...@bytewise.at-20100503115129-uvondrz5bvkqubyv
3119 reinhard.muel...@bytewise.at-20100505081835-9peco6k7a2le0mvg
3120 reinhard.muel...@bytewise.at-20100505084742-wn5vtc4a129z8g28
3121 reinhard.muel...@bytewise.at-20100505092131-m2avvsci5w6aj0rv
3122 reinhard.muel...@bytewise.at-20100519151545-pybk8q2s234vzsf2
3123 reinhard.muel...@bytewise.at-20100525101023-xs7k6pkghh9t6fc3
3124 reinhard.muel...@bytewise.at-20100525114015-rj7eb0xdheqkcuql
3125 reinhard.muel...@bytewise.at-20100525145035-j177jbvu10me4mfp
3126 reinhard.muel...@bytewise.at-20100526111738-ic0wot9z1ulg2y1a
3127 reinhard.muel...@bytewise.at-20100612121357-1nf23tuj1tveh1lv
3128 reinhard.muel...@bytewise.at-20100929190642-6pp6cwlicgt2bhhs
3129 reinhard.muel...@bytewise.at-20100929190817-bje4kkvrjrpanut1
3130 reinhard.muel...@bytewise.at-20101016191602-kceb6hdjytt4im93
3131 reinhard.muel...@bytewise.at-20101020175112-o65lqy8lejjrvzaz
3132 reinhard.muel...@bytewise.at-20101020195535-gb2bt2h80mu5j5h4
3133 reinhard.muel...@bytewise.at-20101020203525-nvdwy7b9r84bngco

Name: bzr:text-parents
   - src/datasources/drivers/Base/ResultSet.py  
reinhard.muel...@bytewise.at-20100612121357-1nf23tuj1tveh1lv

   + 

Modified: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2010-10-20 
20:23:13 UTC (rev 10216)
+++ trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2010-10-20 
20:35:55 UTC (rev 10217)
@@ -589,14 +589,19 @@
 
         assert log.debug('Inserting a blank record in %s' % self)
 
+        if self.__current_index == -1:
+            new_index = self.__record_count
+        else:
+            new_index = self.__current_index + 1
+
         # Don't update the record count and the record pointer yet, so an
         # ON-NEWRECORD trigger can see the old state of the result set.
         record = self.__create_record(
                 defaultData = defaultData,
-                position    = self.__current_index + 1)
+                position    = new_index)
         # Now the trigger has run, we can update our counters.
         self.__record_count += 1
-        self.__current_index += 1
+        self.__current_index = new_index
         self.__sync(True)
         return record
 


_______________________________________________
commit-gnue mailing list
commit-gnue@gnu.org
http://lists.gnu.org/mailman/listinfo/commit-gnue

Reply via email to