aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/controllers
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-07-31 13:15:16 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-07-31 13:15:16 +0200
commit3b3f188e1558987a8a14dc303912e208f77c7b60 (patch)
treeaa75bab5040e0c15db0d3c9942695779e2c696c7 /pyaggr3g470r/controllers
parentThe numver ov values of the splited string is variable (sometimes the charset... (diff)
downloadnewspipe-3b3f188e1558987a8a14dc303912e208f77c7b60.tar.gz
newspipe-3b3f188e1558987a8a14dc303912e208f77c7b60.tar.bz2
newspipe-3b3f188e1558987a8a14dc303912e208f77c7b60.zip
adding munin probes
Diffstat (limited to 'pyaggr3g470r/controllers')
-rw-r--r--pyaggr3g470r/controllers/article.py6
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
bgstack15