本文整理汇总了Python中models.Images.get_by_id方法的典型用法代码示例。如果您正苦于以下问题:Python Images.get_by_id方法的具体用法?Python Images.get_by_id怎么用?Python Images.get_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Images
的用法示例。
在下文中一共展示了Images.get_by_id方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delImageByid
# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import get_by_id [as 别名]
def delImageByid(id):
image=Images.get_by_id(int(id))
if image:
imageblob = db.GqlQuery("SELECT * FROM ImageBlob WHERE image = :1", image).get()
if imageblob:
imageblob.delete()
image.delete()
示例2: delImageByid
# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import get_by_id [as 别名]
def delImageByid(id):
image=Images.get_by_id(int(id))
if image:
DelTags(image.tag)
image.delete()
示例3: getImage
# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import get_by_id [as 别名]
def getImage(id):
id=int(id)
return Images.get_by_id(id)
示例4: delImageByid
# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import get_by_id [as 别名]
def delImageByid(id):
image=Images.get_by_id(int(id))
if image:image.delete()
示例5: get
# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import get_by_id [as 别名]
def get(self, _id):
logging.info(_id)
image = Images.get_by_id(int(_id))
logging.info(image.filename)
self.response.headers[b'Content-Type'] = mimetypes.guess_type(image.filename)[0]
self.response.write(image.blob)