diff options
author | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-08-03 23:55:46 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-08-03 23:55:46 +0200 |
commit | cdbd573500a365e290e88b50d7b0c2355b7f7e19 (patch) | |
tree | 25ede52ae4b02a2377ae40d2c146c7ed2e9abe2a /pyaggr3g470r/controllers/article.py | |
parent | The numver ov values of the splited string is variable (sometimes the charset... (diff) | |
parent | sqlalchemy was requesting icons everytime feed where listed (diff) | |
download | newspipe-cdbd573500a365e290e88b50d7b0c2355b7f7e19.tar.gz newspipe-cdbd573500a365e290e88b50d7b0c2355b7f7e19.tar.bz2 newspipe-cdbd573500a365e290e88b50d7b0c2355b7f7e19.zip |
Merged in jaesivsm/pyaggr3g470r (pull request #20)
perf improvement
Diffstat (limited to 'pyaggr3g470r/controllers/article.py')
-rw-r--r-- | pyaggr3g470r/controllers/article.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pyaggr3g470r/controllers/article.py b/pyaggr3g470r/controllers/article.py index 70b9d2dd..21b4b5e7 100644 --- a/pyaggr3g470r/controllers/article.py +++ b/pyaggr3g470r/controllers/article.py @@ -33,6 +33,12 @@ class ArticleController(AbstractController): .filter(*self._to_filters(**filters)) .group_by(Article.feed_id).all()) + def count_by_user_id(self, **filters): + return dict(db.session.query(Article.user_id, + func.count(Article.id)) + .filter(*self._to_filters(**filters)) + .group_by(Article.user_id).all()) + def create(self, **attrs): # handling special denorm for article rights assert 'feed_id' in attrs |