diff options
Diffstat (limited to 'newspipe/models')
-rw-r--r-- | newspipe/models/__init__.py | 28 | ||||
-rw-r--r-- | newspipe/models/article.py | 3 | ||||
-rw-r--r-- | newspipe/models/bookmark.py | 7 | ||||
-rw-r--r-- | newspipe/models/category.py | 3 | ||||
-rw-r--r-- | newspipe/models/feed.py | 8 | ||||
-rw-r--r-- | newspipe/models/user.py | 5 |
6 files changed, 30 insertions, 24 deletions
diff --git a/newspipe/models/__init__.py b/newspipe/models/__init__.py index 6b64b4cc..a820a43b 100644 --- a/newspipe/models/__init__.py +++ b/newspipe/models/__init__.py @@ -26,15 +26,23 @@ __revision__ = "$Date: 2014/04/12 $" __copyright__ = "Copyright (c) Cedric Bonhomme" __license__ = "GPLv3" +from sqlalchemy.engine import reflection +from sqlalchemy.schema import ( + DropConstraint, + DropTable, + ForeignKeyConstraint, + MetaData, + Table +) + +from .article import Article +from .bookmark import Bookmark +from .category import Category from .feed import Feed +from .icon import Icon from .role import Role +from .tag import ArticleTag, BookmarkTag from .user import User -from .article import Article -from .icon import Icon -from .category import Category -from .tag import BookmarkTag -from .tag import ArticleTag -from .bookmark import Bookmark __all__ = [ "Feed", @@ -49,14 +57,6 @@ __all__ = [ ] -from sqlalchemy.engine import reflection -from sqlalchemy.schema import ( - MetaData, - Table, - DropTable, - ForeignKeyConstraint, - DropConstraint, -) def db_empty(db): diff --git a/newspipe/models/article.py b/newspipe/models/article.py index 0a747a30..78efd9e2 100644 --- a/newspipe/models/article.py +++ b/newspipe/models/article.py @@ -26,11 +26,12 @@ __revision__ = "$Date: 2016/10/04 $" __copyright__ = "Copyright (c) Cedric Bonhomme" __license__ = "GPLv3" -from newspipe.bootstrap import db from datetime import datetime + from sqlalchemy import Index from sqlalchemy.ext.associationproxy import association_proxy +from newspipe.bootstrap import db from newspipe.models.right_mixin import RightMixin diff --git a/newspipe/models/bookmark.py b/newspipe/models/bookmark.py index 93158bbd..ddf7924d 100644 --- a/newspipe/models/bookmark.py +++ b/newspipe/models/bookmark.py @@ -26,14 +26,15 @@ __revision__ = "$Date: 2016/12/07 $" __copyright__ = "Copyright (c) Cedric Bonhomme" __license__ = "GPLv3" -from newspipe.bootstrap import db from datetime import datetime + from sqlalchemy import desc -from sqlalchemy.orm import validates from sqlalchemy.ext.associationproxy import association_proxy +from sqlalchemy.orm import validates -from newspipe.models.tag import BookmarkTag +from newspipe.bootstrap import db from newspipe.models.right_mixin import RightMixin +from newspipe.models.tag import BookmarkTag class Bookmark(db.Model, RightMixin): diff --git a/newspipe/models/category.py b/newspipe/models/category.py index 3abb6717..a1e1c806 100644 --- a/newspipe/models/category.py +++ b/newspipe/models/category.py @@ -1,8 +1,9 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- -from newspipe.bootstrap import db from sqlalchemy import Index + +from newspipe.bootstrap import db from newspipe.models.right_mixin import RightMixin diff --git a/newspipe/models/feed.py b/newspipe/models/feed.py index a84553bf..1521d362 100644 --- a/newspipe/models/feed.py +++ b/newspipe/models/feed.py @@ -26,12 +26,14 @@ __revision__ = "$Date: 2014/04/12 $" __copyright__ = "Copyright (c) Cedric Bonhomme" __license__ = "GPLv3" -from newspipe.bootstrap import db from datetime import datetime -from sqlalchemy import desc, Index + +from sqlalchemy import Index, desc from sqlalchemy.orm import validates -from newspipe.models.right_mixin import RightMixin + +from newspipe.bootstrap import db from newspipe.models.article import Article +from newspipe.models.right_mixin import RightMixin class Feed(db.Model, RightMixin): diff --git a/newspipe/models/user.py b/newspipe/models/user.py index f880d3fe..179474a6 100644 --- a/newspipe/models/user.py +++ b/newspipe/models/user.py @@ -28,14 +28,15 @@ __license__ = "GPLv3" import re from datetime import datetime -from werkzeug.security import check_password_hash + from flask_login import UserMixin from sqlalchemy.orm import validates +from werkzeug.security import check_password_hash from newspipe.bootstrap import db -from newspipe.models.right_mixin import RightMixin from newspipe.models.category import Category from newspipe.models.feed import Feed +from newspipe.models.right_mixin import RightMixin class User(db.Model, UserMixin, RightMixin): |