本文整理汇总了Python中data_class.Stream.reset_image_num方法的典型用法代码示例。如果您正苦于以下问题:Python Stream.reset_image_num方法的具体用法?Python Stream.reset_image_num怎么用?Python Stream.reset_image_num使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类data_class.Stream
的用法示例。
在下文中一共展示了Stream.reset_image_num方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from data_class import Stream [as 别名]
# 或者: from data_class.Stream import reset_image_num [as 别名]
def post(self):
print "************delete stream******************"
data = json.loads(self.request.body)
user = data['user']
for stream_id in data['stream_id']:
qry = Stream.query(Stream.stream_id == stream_id).fetch()
if len(qry) > 0:
#delete all the images in this stream
image_query = db.GqlQuery("SELECT *FROM Image WHERE ANCESTOR IS :1 ORDER BY upload_date DESC",
db.Key.from_path('Stream', stream_id))
for image in image_query[0:qry[0].num_images]:
image.delete()
print "******************delete images"
Stream.reset_image_num(qry[0].stream_id)
#delete stream
qry[0].key.delete()
self.redirect('/manage')