diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-08-03 14:36:13 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-08-03 15:50:41 +0200 |
commit | 0caffceec8b58bc3f78c0d8ea36d2f7e9da668ec (patch) | |
tree | 25ede52ae4b02a2377ae40d2c146c7ed2e9abe2a /pyaggr3g470r/models/feed.py | |
parent | ensuring the icon isn't empty and redoing a bit of logging (diff) | |
download | newspipe-0caffceec8b58bc3f78c0d8ea36d2f7e9da668ec.tar.gz newspipe-0caffceec8b58bc3f78c0d8ea36d2f7e9da668ec.tar.bz2 newspipe-0caffceec8b58bc3f78c0d8ea36d2f7e9da668ec.zip |
sqlalchemy was requesting icons everytime feed where listed
so i choosed to move the icons into their own table
Diffstat (limited to 'pyaggr3g470r/models/feed.py')
-rw-r--r-- | pyaggr3g470r/models/feed.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pyaggr3g470r/models/feed.py b/pyaggr3g470r/models/feed.py index 75e55df1..07b0fc99 100644 --- a/pyaggr3g470r/models/feed.py +++ b/pyaggr3g470r/models/feed.py @@ -35,7 +35,7 @@ class Feed(db.Model): """ Represent a feed. """ - id = db.Column(db.Integer, primary_key=True) + id = db.Column(db.Integer(), primary_key=True) title = db.Column(db.String(), default="") description = db.Column(db.String(), default="FR") link = db.Column(db.String()) @@ -43,7 +43,6 @@ class Feed(db.Model): enabled = db.Column(db.Boolean(), default=True) created_date = db.Column(db.DateTime(), default=datetime.now) filters = db.Column(db.PickleType, default=[]) - icon = db.Column(db.String(), default="") # cache handling etag = db.Column(db.String(), default="") @@ -55,7 +54,8 @@ class Feed(db.Model): error_count = db.Column(db.Integer(), default=0) # relationship - user_id = db.Column(db.Integer, db.ForeignKey('user.id')) + icon_url = db.Column(db.String(), db.ForeignKey('icon.url'), default=None) + user_id = db.Column(db.Integer(), db.ForeignKey('user.id')) articles = db.relationship('Article', backref='source', lazy='dynamic', cascade='all,delete-orphan', order_by=desc("Article.date")) @@ -71,7 +71,7 @@ class Feed(db.Model): "link": self.link, "site_link": self.site_link, "etag": self.etag, - "icon": self.icon, + "icon_url": self.icon_url, "error_count": self.error_count, "last_modified": self.last_modified, "last_retrieved": self.last_retrieved} |