main.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:tellmeabout.coffee 作者: billyfung 项目源码 文件源码
def get_coffee_image(coffee_id):
    """Gets the image attached to the coffee"""
    coffee_int_id = int(coffee_id)
    coffee = memcache.get("coffee_image_{}".format(coffee_int_id))
    if not coffee:
        coffee = Coffee.get_by_id(coffee_int_id)
        memcache.set("coffee_image_{}".format(coffee_int_id), coffee)
    if coffee:
        if coffee.image:
            return send_file(io.BytesIO(coffee.image))
    return app.send_static_file('coffee.png')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号