本文整理汇总了Python中models.Entry.latest_unpublished方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.latest_unpublished方法的具体用法?Python Entry.latest_unpublished怎么用?Python Entry.latest_unpublished使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Entry
的用法示例。
在下文中一共展示了Entry.latest_unpublished方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: unpublished_entries_for_feed
# 需要导入模块: from models import Entry [as 别名]
# 或者: from models.Entry import latest_unpublished [as 别名]
def unpublished_entries_for_feed(feed_type, feed_id):
feed = FEED_TYPE_TO_CLASS[feed_type].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_json() for entry in Entry.latest_unpublished(feed).fetch(20)]
feed_data['entries'] = entries
return jsonify(status='ok', data=feed_data)
示例2: unpublished_entries_for_feed
# 需要导入模块: from models import Entry [as 别名]
# 或者: from models.Entry import latest_unpublished [as 别名]
def unpublished_entries_for_feed(feed_id):
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_json(include=['title', 'link', 'published', 'published_at']) for entry in Entry.latest_unpublished(feed).fetch(20)]
feed_data['entries'] = entries
return jsonify(status='ok', data=feed_data)