aboutsummaryrefslogtreecommitdiff
path: root/newspipe/models
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2021-07-03 21:49:20 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2021-07-03 21:49:20 +0200
commit119a8f3e7c2dc0840312ee9e051b899e7b2c031d (patch)
treeaa3167f93e823efa34894766a82d3d025cda8048 /newspipe/models
parentdelete read articles retrieved since more than 15 days. (diff)
downloadnewspipe-119a8f3e7c2dc0840312ee9e051b899e7b2c031d.tar.gz
newspipe-119a8f3e7c2dc0840312ee9e051b899e7b2c031d.tar.bz2
newspipe-119a8f3e7c2dc0840312ee9e051b899e7b2c031d.zip
deleted read article (and not liked) that are retrieved since more than 15 days.
Diffstat (limited to 'newspipe/models')
-rw-r--r--newspipe/models/article.py20
-rw-r--r--newspipe/models/feed.py11
-rw-r--r--newspipe/models/tag.py5
3 files changed, 16 insertions, 20 deletions
diff --git a/newspipe/models/article.py b/newspipe/models/article.py
index a8c247c0..1da56c64 100644
--- a/newspipe/models/article.py
+++ b/newspipe/models/article.py
@@ -64,17 +64,15 @@ class Article(db.Model, RightMixin):
tags = association_proxy("tag_objs", "text")
__table_args__ = (
- ForeignKeyConstraint([user_id], ['user.id'], ondelete='CASCADE'),
- ForeignKeyConstraint([feed_id], ['feed.id'], ondelete='CASCADE'),
- ForeignKeyConstraint([category_id], ['category.id'],
- ondelete='CASCADE'),
- Index('ix_article_eid_cid_uid', user_id, category_id, entry_id),
- Index('ix_article_retrdate', retrieved_date),
-
- Index('user_id'),
- Index('user_id', 'category_id'),
- Index('user_id', 'feed_id'),
- Index('ix_article_uid_fid_eid', user_id, feed_id, entry_id)
+ ForeignKeyConstraint([user_id], ["user.id"], ondelete="CASCADE"),
+ ForeignKeyConstraint([feed_id], ["feed.id"], ondelete="CASCADE"),
+ ForeignKeyConstraint([category_id], ["category.id"], ondelete="CASCADE"),
+ Index("ix_article_eid_cid_uid", user_id, category_id, entry_id),
+ Index("ix_article_retrdate", retrieved_date),
+ Index("user_id"),
+ Index("user_id", "category_id"),
+ Index("user_id", "feed_id"),
+ Index("ix_article_uid_fid_eid", user_id, feed_id, entry_id),
)
# api whitelists
diff --git a/newspipe/models/feed.py b/newspipe/models/feed.py
index 12622285..7e8d92ae 100644
--- a/newspipe/models/feed.py
+++ b/newspipe/models/feed.py
@@ -73,12 +73,11 @@ class Feed(db.Model, RightMixin):
)
__table_args__ = (
- ForeignKeyConstraint([user_id], ['user.id'], ondelete='CASCADE'),
- ForeignKeyConstraint([category_id], ['category.id'],
- ondelete='CASCADE'),
- ForeignKeyConstraint([icon_url], ['icon.url']),
- Index('ix_feed_uid', user_id),
- Index('ix_feed_uid_cid', user_id, category_id),
+ ForeignKeyConstraint([user_id], ["user.id"], ondelete="CASCADE"),
+ ForeignKeyConstraint([category_id], ["category.id"], ondelete="CASCADE"),
+ ForeignKeyConstraint([icon_url], ["icon.url"]),
+ Index("ix_feed_uid", user_id),
+ Index("ix_feed_uid_cid", user_id, category_id),
)
# idx_feed_uid_cid = Index("user_id", "category_id")
diff --git a/newspipe/models/tag.py b/newspipe/models/tag.py
index 0a0fe58c..02a6d29f 100644
--- a/newspipe/models/tag.py
+++ b/newspipe/models/tag.py
@@ -23,9 +23,8 @@ class ArticleTag(db.Model):
self.text = text
__table_args__ = (
- ForeignKeyConstraint([article_id], ['article.id'],
- ondelete='CASCADE'),
- Index('ix_articletag_aid', article_id),
+ ForeignKeyConstraint([article_id], ["article.id"], ondelete="CASCADE"),
+ Index("ix_articletag_aid", article_id),
)
bgstack15