diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-10-04 11:39:25 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-10-04 11:39:25 +0200 |
commit | e36f64813e6f12d541d69bdb1619dbf29b2d8c92 (patch) | |
tree | 4fa59353ed38f9c0ccc87ed9de5410a40bb91248 /src/web/models/category.py | |
parent | Removed duplicate glyphicon. (diff) | |
download | newspipe-e36f64813e6f12d541d69bdb1619dbf29b2d8c92.tar.gz newspipe-e36f64813e6f12d541d69bdb1619dbf29b2d8c92.tar.bz2 newspipe-e36f64813e6f12d541d69bdb1619dbf29b2d8c92.zip |
Fixed a bug when removing a user who have feeds in categories.
Diffstat (limited to 'src/web/models/category.py')
-rw-r--r-- | src/web/models/category.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/web/models/category.py b/src/web/models/category.py index c35db52e..15b616bf 100644 --- a/src/web/models/category.py +++ b/src/web/models/category.py @@ -7,8 +7,13 @@ class Category(db.Model, RightMixin): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String()) + # relationships user_id = db.Column(db.Integer, db.ForeignKey('user.id')) + feeds = db.relationship('Feed', cascade='all,delete-orphan') + articles = db.relationship('Article', + cascade='all,delete-orphan') + # index idx_category_uid = Index('user_id') # api whitelists |