def get(self): for feed in all_feeds: feed_item = Feed.all().filter('path =', feed['path']).fetch(1) key = None if feed_item: feed_item = feed_item[0] key = feed_item.key() else: feed_item = Feed(content =[], path = feed['path']) key = feed_item.put() taskqueue.add(url='/task/rss'+feed['path'], params={'key': key, 'url': root % feed['path']})
def get(self, feed_name): json_feed = [] feed_name = feed_name or "" feed = Feed.all().filter("path =", feed_name).fetch(1); if feed: feed = feed[0] for content in feed.content: content_item = db.get(content) if content_item and content_item.section_name: #section is added by the api worker as the last step of preparation #no section and its probably bogus json_feed.append(self.summary_url + content_item.id) else: if content_item: logging.info("Content item: %s is not ready" % content_item.web_url) else: logging.info("Content item missing in action") else: logging.info("Couldn't find feed: %s" % feed_name) self.returnJSON(json_feed)