diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-10-12 17:48:41 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2016-01-26 23:46:31 +0100 |
commit | 7cbbcb59f4c434fbd7e74e85c90e98fadd189b65 (patch) | |
tree | f979fd6300b8767c8bbca0a7ac5c3ee831df49df /src/web/controllers/article.py | |
parent | updating translations (diff) | |
download | newspipe-7cbbcb59f4c434fbd7e74e85c90e98fadd189b65.tar.gz newspipe-7cbbcb59f4c434fbd7e74e85c90e98fadd189b65.tar.bz2 newspipe-7cbbcb59f4c434fbd7e74e85c90e98fadd189b65.zip |
adding, improving UI to manage categories
Diffstat (limited to 'src/web/controllers/article.py')
-rw-r--r-- | src/web/controllers/article.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/web/controllers/article.py b/src/web/controllers/article.py index 72288a09..50e6757f 100644 --- a/src/web/controllers/article.py +++ b/src/web/controllers/article.py @@ -28,12 +28,11 @@ class ArticleController(AbstractController): continue yield id_ + def count_by_category(self, **filters): + return self._count_by(Article.category_id, filters) + def count_by_feed(self, **filters): - if self.user_id: - filters['user_id'] = self.user_id - return dict(db.session.query(Article.feed_id, func.count(Article.id)) - .filter(*self._to_filters(**filters)) - .group_by(Article.feed_id).all()) + return self._count_by(Article.feed_id, filters) def count_by_user_id(self, **filters): return dict(db.session.query(Article.user_id, func.count(Article.id)) |