From 5dcac6f53dc14bb345c7f1167b42e25aebbf5729 Mon Sep 17 00:00:00 2001 From: lxnay Date: Tue, 28 Oct 2008 21:47:54 +0000 Subject: [PATCH] Entropy/DistributionUGCInterface: - insert_keywords(): improve query git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2586 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/entropy.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/entropy.py b/libraries/entropy.py index 9f58452a0..5f4527bb9 100644 --- a/libraries/entropy.py +++ b/libraries/entropy.py @@ -18046,10 +18046,11 @@ class DistributionUGCInterface(RemoteDbSkelInterface): if not clean_keys: return - def myiter(): - for key in clean_keys: - yield (iddoc, key,) - self.execute_many('INSERT INTO entropy_docs_keywords VALUES (%s,%s)', myiter) + mydata = [] + for key in clean_keys: + mydata.append((iddoc, key,)) + + self.execute_many('INSERT INTO entropy_docs_keywords VALUES (%s,%s)', mydata) def remove_keywords(self, iddoc): self.execute_query('DELETE FROM entropy_docs_keywords WHERE `iddoc` = %s',(iddoc,))