page_api.py 文件源码

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

项目:bottle-py 作者: today-open 项目源码 文件源码
def native_latest_news(db):
    all = db.query(Page).filter_by(type=10).order_by(desc(Page.id)).limit(10)
    if all:
        return json.dumps([{
            'id': page.id,
            'key': page.id,
            'title': page.title,
            'cover': page.cover,
            'type': page.type,
            'tag': page.tag,
            'author': {
                'id': page.author.id,
                'name': page.author.name
            },
            'time': page.time
        } for page in all])
    return HTTPError(404, 'id not found.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号