aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-10-30 18:53:51 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-10-30 18:53:51 +0100
commitd886da6bbe7ae8b0cf5b373d41c56c9847d6dc85 (patch)
treec015362829bfadb04907da9d39914268d818d57a /pyaggr3g470r
parentUpdated requirements.txt (diff)
downloadnewspipe-d886da6bbe7ae8b0cf5b373d41c56c9847d6dc85.tar.gz
newspipe-d886da6bbe7ae8b0cf5b373d41c56c9847d6dc85.tar.bz2
newspipe-d886da6bbe7ae8b0cf5b373d41c56c9847d6dc85.zip
count() is way faster than len().
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 4a8551ab..1a0408ee 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -75,10 +75,13 @@ def favorites():
@app.route('/unread/', methods=['GET'])
def unread():
feeds = models.Feed.objects().filter(articles__readed=False)
+
+ unread_articles = models.Article.objects.filter(readed = False)
+
print len(feeds)
return render_template('unread.html', feeds=feeds)
@app.route('/management/', methods=['GET'])
def management():
- nb_article = len(models.Article.objects())
+ nb_article = models.Article.objects().count()
return render_template('management.html', nb_article=nb_article) \ No newline at end of file
bgstack15