diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-10-30 18:53:51 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-10-30 18:53:51 +0100 |
commit | d886da6bbe7ae8b0cf5b373d41c56c9847d6dc85 (patch) | |
tree | c015362829bfadb04907da9d39914268d818d57a /pyaggr3g470r/views.py | |
parent | Updated requirements.txt (diff) | |
download | newspipe-d886da6bbe7ae8b0cf5b373d41c56c9847d6dc85.tar.gz newspipe-d886da6bbe7ae8b0cf5b373d41c56c9847d6dc85.tar.bz2 newspipe-d886da6bbe7ae8b0cf5b373d41c56c9847d6dc85.zip |
count() is way faster than len().
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r-- | pyaggr3g470r/views.py | 5 |
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 |