Commits

MattMaker committed adc9050

use sqla's inserted_primary_key[0] rather than deprecated last_inserted_ids()[0]

see also http://www.sqlalchemy.org/docs/core/connections.html#sqlalchemy.engine.base.ResultProxy.inserted_primary_key

Comments (0)

Files changed (2)

MoinMoin/storage/backends/indexing.py

         item_id = self.get_item_id(uuid)
         if item_id is None:
             res = item_table.insert().values(uuid=uuid, name=name).execute()
-            item_id = res.last_inserted_ids()[0]
+            item_id = res.inserted_primary_key[0]
         self.item_kvstore.store_kv(item_id, metas)
         return item_id
 
         else:
             dt = datetime.datetime.utcfromtimestamp(timestamp)
             res = rev_table.insert().values(revno=revno, item_id=item_id, datetime=dt).execute()
-            rev_id = res.last_inserted_ids()[0]
+            rev_id = res.inserted_primary_key[0]
 
         self.rev_kvstore.store_kv(rev_id, metas)
 

MoinMoin/util/kvstore.py

                    wanted_value_type, value_type, name, value)
         else:
             res = key_table.insert().values(name=name, value_type=value_type).execute()
-            key_id = res.last_inserted_ids()[0]
+            key_id = res.inserted_primary_key[0]
         return key_id
 
     def _get_value_id(self, value):
             value_id = result[0]
         else:
             res = value_table.insert().values(value=value).execute()
-            value_id = res.last_inserted_ids()[0]
+            value_id = res.inserted_primary_key[0]
         return value_id
 
     def _associate(self, ref_id, key_id, value_id):