本文整理汇总了Python中models.Entry.latest_for_feed方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.latest_for_feed方法的具体用法?Python Entry.latest_for_feed怎么用?Python Entry.latest_for_feed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Entry
的用法示例。
在下文中一共展示了Entry.latest_for_feed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: feed_change
# 需要导入模块: from models import Entry [as 别名]
# 或者: from models.Entry import latest_for_feed [as 别名]
def feed_change(feed_id):
"""Get a feed"""
form = FeedUpdate(request.form)
if not form.validate():
return jsonify_error(message="Invalid update data")
feed = Feed.get_by_id(feed_id, parent=g.user.key)
if not feed:
return jsonify_error(message="Can't find that feed")
form.populate_obj(feed)
feed.put()
feed_data = feed.to_json()
entries = [entry.to_dict(include=['title', 'link', 'published', 'published_at']) for entry in Entry.latest_for_feed(feed).fetch(10)]
feed_data['entries'] = entries
return jsonify(status='ok', data=feed_data)
示例2: feed
# 需要导入模块: from models import Entry [as 别名]
# 或者: from models.Entry import latest_for_feed [as 别名]
def feed(feed_id):
"""Get a feed"""
feed = Feed.get_by_id(feed_id, parent=g.user.key)
if not feed:
return jsonify_error(message="Can't find that feed")
feed_data = feed.to_json()
entries = [entry.to_dict(include=['guid', 'published', 'extra_info']) for entry in Entry.latest_for_feed(feed).fetch(10)]
feed_data['entries'] = entries
return jsonify(status='ok', data=feed_data)