aboutsummaryrefslogtreecommitdiff
path: root/src/web/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/models')
-rw-r--r--src/web/models/__init__.py8
-rw-r--r--src/web/models/article.py8
-rw-r--r--src/web/models/user.py4
3 files changed, 6 insertions, 14 deletions
diff --git a/src/web/models/__init__.py b/src/web/models/__init__.py
index 229a99e5..1fc0c3e0 100644
--- a/src/web/models/__init__.py
+++ b/src/web/models/__init__.py
@@ -32,13 +32,9 @@ from .user import User
from .article import Article
from .icon import Icon
from .category import Category
-#from .tag import Tag
-from .tag import BookmarkTag
-from .tag import ArticleTag
-from .bookmark import Bookmark
+from .tag import Tag
-__all__ = ['Feed', 'Role', 'User', 'Article', 'Icon', 'Category', 'Tag',
- 'Bookmark', 'ArticleTag', 'BookmarkTag']
+__all__ = ['Feed', 'Role', 'User', 'Article', 'Icon', 'Category', 'Tag']
import os
diff --git a/src/web/models/article.py b/src/web/models/article.py
index f5ef619e..87ad1a9a 100644
--- a/src/web/models/article.py
+++ b/src/web/models/article.py
@@ -52,10 +52,10 @@ class Article(db.Model, RightMixin):
category_id = db.Column(db.Integer(), db.ForeignKey('category.id'))
# relationships
- tag_objs = db.relationship('ArticleTag', back_populates='article',
- cascade='all,delete-orphan',
- lazy=False,
- foreign_keys='[ArticleTag.article_id]')
+ tag_objs = db.relationship('Tag', back_populates='article',
+ cascade='all,delete-orphan',
+ lazy=False,
+ foreign_keys='[Tag.article_id]')
tags = association_proxy('tag_objs', 'text')
# index
diff --git a/src/web/models/user.py b/src/web/models/user.py
index d2b3c52a..460958e0 100644
--- a/src/web/models/user.py
+++ b/src/web/models/user.py
@@ -38,7 +38,6 @@ from bootstrap import db
from web.models.right_mixin import RightMixin
from web.models.category import Category
from web.models.feed import Feed
-from web.models.bookmark import Bookmark
class User(db.Model, UserMixin, RightMixin):
@@ -72,9 +71,6 @@ class User(db.Model, UserMixin, RightMixin):
feeds = db.relationship('Feed', backref='user',
cascade='all, delete-orphan',
foreign_keys=[Feed.user_id])
- bookmarks = db.relationship('Bookmark', backref='user',
- cascade='all, delete-orphan',
- foreign_keys=[Bookmark.user_id])
@staticmethod
def _fields_base_write():
bgstack15