diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2017-04-21 23:09:42 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2017-04-21 23:09:42 +0200 |
commit | 0fa1a1c363aaf934a9ce80ee8b255cf8b840901e (patch) | |
tree | 22bea067f592a988dac3f3028c17eeed74f85f6f /src/web/models/bookmark.py | |
parent | Merge branch 'master' into bookmark (diff) | |
download | newspipe-0fa1a1c363aaf934a9ce80ee8b255cf8b840901e.tar.gz newspipe-0fa1a1c363aaf934a9ce80ee8b255cf8b840901e.tar.bz2 newspipe-0fa1a1c363aaf934a9ce80ee8b255cf8b840901e.zip |
We will finally have a table for tags of articles and tags of bookmarks.
Diffstat (limited to 'src/web/models/bookmark.py')
-rw-r--r-- | src/web/models/bookmark.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/web/models/bookmark.py b/src/web/models/bookmark.py index 6101a5f0..891c3eda 100644 --- a/src/web/models/bookmark.py +++ b/src/web/models/bookmark.py @@ -34,13 +34,6 @@ from sqlalchemy.ext.associationproxy import association_proxy from web.models.right_mixin import RightMixin -bookmarktags_table = db.Table('bookmarktags', db.metadata, - db.Column('bookmark_id', db.Integer, db.ForeignKey("bookmark.id"), - primary_key=True), - db.Column('tag_text', db.String, db.ForeignKey("BookmarkTag.text"), - primary_key=True) -) - class Bookmark(db.Model, RightMixin): """ Represent a bookmark. @@ -55,11 +48,10 @@ class Bookmark(db.Model, RightMixin): user_id = db.Column(db.Integer(), db.ForeignKey('user.id')) # relationships - tag_objs = db.relationship("BookmarkTag", secondary=lambda: bookmarktags_table) - # tag_objs = db.relationship('BookmarkTag', back_populates='bookmark', - # cascade='all,delete-orphan', - # lazy=False, - # foreign_keys='[BookmarkTag.bookmark_id]') + tag_objs = db.relationship('BookmarkTag', back_populates='bookmark', + cascade='all,delete-orphan', + lazy=False, + foreign_keys='[BookmarkTag.bookmark_id]') tags = association_proxy('tag_objs', 'text') |