aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/controllers/article.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r/controllers/article.py')
-rw-r--r--pyaggr3g470r/controllers/article.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/pyaggr3g470r/controllers/article.py b/pyaggr3g470r/controllers/article.py
index 0de223ee..46ca0988 100644
--- a/pyaggr3g470r/controllers/article.py
+++ b/pyaggr3g470r/controllers/article.py
@@ -7,9 +7,9 @@ class ArticleController(AbstractController):
_db_cls = Article
def get(self, **filters):
- article = super(ArticleController, self).read(**filters)
+ article = super(ArticleController, self).get(**filters)
if not article.readed:
- self.update(article.id, readed=True)
+ self.update({'id': article.id}, {'readed': True})
return article
def delete(self, obj_id):
@@ -18,3 +18,10 @@ class ArticleController(AbstractController):
import pyaggr3g470r.search as fastsearch
fastsearch.delete_article(self.user_id, obj.feed_id, obj_id)
return obj
+
+ def challenge(self, ids):
+ """Will return each id that wasn't found in the database."""
+ for id_ in ids:
+ if self.read(**id_).first():
+ continue
+ yield id_
bgstack15