diff options
Diffstat (limited to 'src/web/models')
-rw-r--r-- | src/web/models/article.py | 1 | ||||
-rw-r--r-- | src/web/models/category.py | 11 | ||||
-rw-r--r-- | src/web/models/feed.py | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/web/models/article.py b/src/web/models/article.py index 2a5f4329..91be9846 100644 --- a/src/web/models/article.py +++ b/src/web/models/article.py @@ -40,7 +40,6 @@ class Article(db.Model): content = db.Column(db.String()) readed = db.Column(db.Boolean(), default=False) like = db.Column(db.Boolean(), default=False) - #notes = db.Column(db.String(), default="") date = db.Column(db.DateTime(), default=datetime.now) retrieved_date = db.Column(db.DateTime(), default=datetime.now) diff --git a/src/web/models/category.py b/src/web/models/category.py new file mode 100644 index 00000000..78054809 --- /dev/null +++ b/src/web/models/category.py @@ -0,0 +1,11 @@ +from bootstrap import db + + +class Category(db.Model): + id = db.Column(db.Integer(), primary_key=True) + name = db.Column(db.String()) + + user_id = db.Column(db.Integer, db.ForeignKey('user.id')) + + def dump(self): + return {key: getattr(self, key) for key in ('id', 'name', 'user_id')} diff --git a/src/web/models/feed.py b/src/web/models/feed.py index 9d08a972..29d5bc4c 100644 --- a/src/web/models/feed.py +++ b/src/web/models/feed.py @@ -67,6 +67,7 @@ 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, |