From 9c225a5b72d860221ebe9b4f21e2450ffc1bc982 Mon Sep 17 00:00:00 2001 From: Chaz Date: Tue, 28 Sep 2010 23:34:20 -0400 Subject: [PATCH] * Updated storeHandsPlayers() to insert via executemany() if 'saveActions' is False and via looped execute() to call get_last_insert_id() if 'saveActions' is True --- pyfpdb/Database.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index d3deb578..e94074c4 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1782,10 +1782,13 @@ class Database: #print "DEBUG: q: %s" % q c = self.get_cursor() - for r in inserts: - c.execute(q, r) - hpid[(r[0], r[1])] = self.get_last_insert_id(c) - + if self.import_options['saveActions']: + for r in inserts: + c.execute(q, r) + hpid[(r[0], r[1])] = self.get_last_insert_id(c) + else: + c.executemany(q, inserts) + return hpid def storeHandsActions(self, hid, pids, hpid, adata, printdata = False):