本文整理汇总了Python中models.Entry.delete_for_feed方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.delete_for_feed方法的具体用法?Python Entry.delete_for_feed怎么用?Python Entry.delete_for_feed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Entry
的用法示例。
在下文中一共展示了Entry.delete_for_feed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete_feed
# 需要导入模块: from models import Entry [as 别名]
# 或者: from models.Entry import delete_for_feed [as 别名]
def delete_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")
Entry.delete_for_feed(feed)
feed.key.delete()
return jsonify(status='ok')
示例2: delete_feed
# 需要导入模块: from models import Entry [as 别名]
# 或者: from models.Entry import delete_for_feed [as 别名]
def delete_feed(feed_type, feed_id):
"""Get a feed"""
feed = FEED_TYPE_TO_CLASS[feed_type].get_by_id(feed_id, parent=g.user.key)
if not feed:
raise ndb.Return(jsonify_error(message="Can't find that feed"))
yield Entry.delete_for_feed(feed)
yield feed.key.delete_async()
raise ndb.Return(jsonify(status='ok'))