diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-10-12 22:36:01 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2016-01-26 23:46:32 +0100 |
commit | 2c0e17cb977a1e8782799b337df8b1583d019906 (patch) | |
tree | 75563e440e9eac14950fa1a71a83e64df20e52d0 /src/web/models | |
parent | fixing sqlalchemy resolving warning (diff) | |
download | newspipe-2c0e17cb977a1e8782799b337df8b1583d019906.tar.gz newspipe-2c0e17cb977a1e8782799b337df8b1583d019906.tar.bz2 newspipe-2c0e17cb977a1e8782799b337df8b1583d019906.zip |
bootstraping react
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, |