From 9fcfa77f3f13a6d6e5833e7f78723909d43a4605 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Sat, 3 Mar 2012 20:48:52 +0100 Subject: Favorite page is now working with MongoDB. --- pyAggr3g470r.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index abbb6760..2658e1e6 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -1058,21 +1058,22 @@ class Root: """ List of favorites articles """ + feeds = self.articles.get_all_collections() html = htmlheader() html += htmlnav html += """
""" html += "

Your favorites articles

" - for feed in self.feeds.values(): + for feed in feeds: new_feed_section = True - for article in feed.articles.values(): - if article.like == "1": + for article in self.articles.get_articles_from_collection(feed["feed_id"]): + if article["article_like"] == True: if new_feed_section is True: new_feed_section = False html += """

%s

\n""" % \ - (feed.feed_id, feed.feed_site_link, feed.feed_title, feed.feed_link, feed.feed_image) + (feed["feed_id"], feed["site_link"], feed["feed_title"], feed["feed_link"], feed["feed_image"]) # descrition for the CSS ToolTips - article_content = utils.clear_string(article.article_description) + article_content = utils.clear_string(article["article_description"]) if article_content: description = " ".join(article_content[:500].split(' ')[:-1]) else: @@ -1082,7 +1083,7 @@ class Root: # CSS description tooltips on mouse over) html += article.article_date + " - " + \ """%s%s
\n""" % \ - (feed.feed_id, article.article_id, article.article_title[:150], description) + (feed["feed_id"], article["article_id"], article["article_title"][:150], description) html += "
\n" html += htmlfooter return html -- cgit