Example #1
0
 def clear_index(self):
     topic_id_tuple = tuple(
         set(x['topic_id'] for x in self.topic_index_list))
     sql = 'DELETE  from TopicIndex where topic_id in ({})'.format(
         (' ?,' * len(topic_id_tuple))[:-1])
     SqlClass.cursor.execute(sql, topic_id_tuple)
     SqlClass.commit()
     return
Example #2
0
 def save(self):
     self.clear_index()
     save_config = self.create_save_config()
     for key in save_config:
         for item in save_config[key]:
             if item:
                 SqlClass.save2DB(item, key)
     SqlClass.commit()
     return
Example #3
0
 def save(self):
     self.clear_index()
     save_config = self.create_save_config()
     for key in save_config:
         for item in save_config[key]:
             if item:
                 SqlClass.save2DB(item, key)
     SqlClass.commit()
     return
Example #4
0
 def clear_index(self):
     topic_id_tuple = tuple(set(x['topic_id'] for x in self.topic_index_list))
     sql = 'DELETE  from TopicIndex where topic_id in ({})'.format((' ?,' * len(topic_id_tuple))[:-1])
     SqlClass.cursor.execute(sql, topic_id_tuple)
     SqlClass.commit()
     return