From 2c0e17cb977a1e8782799b337df8b1583d019906 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Mon, 12 Oct 2015 22:36:01 +0200 Subject: bootstraping react --- src/web/models/article.py | 1 - src/web/models/category.py | 11 +++++++++++ src/web/models/feed.py | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/web/models/category.py (limited to 'src/web/models') 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, -- cgit