aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r/controllers')
-rw-r--r--pyaggr3g470r/controllers/article.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pyaggr3g470r/controllers/article.py b/pyaggr3g470r/controllers/article.py
index b3a79838..70b9d2dd 100644
--- a/pyaggr3g470r/controllers/article.py
+++ b/pyaggr3g470r/controllers/article.py
@@ -26,11 +26,12 @@ class ArticleController(AbstractController):
continue
yield id_
- def get_unread(self):
+ 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(readed=False,
- user_id=self.user_id))
- .group_by(Article.feed_id).all())
+ .filter(*self._to_filters(**filters))
+ .group_by(Article.feed_id).all())
def create(self, **attrs):
# handling special denorm for article rights
bgstack15