diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2016-02-02 23:15:37 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2016-02-02 23:15:37 +0100 |
commit | 082bf39a7dd7296d4f51b6b124d185135dc00989 (patch) | |
tree | 6e12cf2b67b016aff38874c389b5bf8b5242749a /src/web/models/feed.py | |
parent | fixing logging (diff) | |
parent | reload and fold all button (diff) | |
download | newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.tar.gz newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.tar.bz2 newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.zip |
Merge branch 'feature/categories'
close #22
close #23
Diffstat (limited to 'src/web/models/feed.py')
-rw-r--r-- | src/web/models/feed.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/web/models/feed.py b/src/web/models/feed.py index 59456a7f..7768ee50 100644 --- a/src/web/models/feed.py +++ b/src/web/models/feed.py @@ -56,9 +56,10 @@ class Feed(db.Model): # relationship icon_url = db.Column(db.String(), db.ForeignKey('icon.url'), default=None) user_id = db.Column(db.Integer(), db.ForeignKey('user.id')) + category_id = db.Column(db.Integer(), db.ForeignKey('category.id')) articles = db.relationship('Article', backref='source', lazy='dynamic', cascade='all,delete-orphan', - order_by=desc("Article.date")) + order_by=desc("date")) def __repr__(self): return '<Feed %r>' % (self.title) @@ -66,12 +67,17 @@ class Feed(db.Model): def dump(self): return {"id": self.id, "user_id": self.user_id, + "category_id": self.category_id, "title": self.title, "description": self.description, "link": self.link, "site_link": self.site_link, "etag": self.etag, + "enabled": self.enabled, + "filters": self.filters, "icon_url": self.icon_url, "error_count": self.error_count, + "last_error": self.last_error, + "created_date": self.created_date, "last_modified": self.last_modified, "last_retrieved": self.last_retrieved} |