From 037272a167dc1c9f8f71c00802e220d1aa2a0c76 Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Thu, 14 Jul 2022 01:11:45 +0000 Subject: [PATCH] not saving description in the database anymore --- database.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/database.py b/database.py index e577fba..5abb15b 100644 --- a/database.py +++ b/database.py @@ -150,11 +150,10 @@ class Database: """Replace last feed items with a list items that receive.""" self.log.debug('update_feed_items(feed_id=\'%s\', new_items=list(%d))', feed_id, len(new_items)) for i, _ in enumerate(new_items): - new_items[i] = [feed_id] + list(new_items[i].__dict__.values())[:-1] - + new_items[i] = [feed_id] + [new_items[i].url, new_items[i].title, new_items[i].guid] self.cur.execute('DELETE FROM feeds_last_items WHERE feed_id = %s', [feed_id]) self.cur.executemany( - 'INSERT INTO feeds_last_items (feed_id, url, title, description, guid) VALUES (%s, %s, %s, %s, %s)', new_items) + 'INSERT INTO feeds_last_items (feed_id, url, title, guid) VALUES (%s, %s, %s, %s)', new_items) self.conn.commit() def __init_schema(self) -> None: @@ -175,7 +174,6 @@ class Database: ' feed_id INTEGER REFERENCES feeds ON DELETE CASCADE,' ' url TEXT NOT NULL,' ' title TEXT,' - ' description TEXT,' ' guid TEXT' ')' )