files.py 文件源码

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

项目:fame 作者: certsocietegenerale 项目源码 文件源码
def index(self):
        """Get the list of objects.

        .. :quickref: File; Get the list of objects

        Response is paginated and will only contain 25 results. The most recent
        objects appear first.

        :query page: page number.
        :type page: int

        :>json list files: list of files (see :http:get:`/files/(id)` for details on the format of a file).
        """
        page = int(request.args.get('page', 1))

        files = current_user.files.find().sort('_id', DESCENDING).limit(PER_PAGE).skip((page - 1) * PER_PAGE)
        pagination = Pagination(page=page, per_page=PER_PAGE, total=files.count(), css_framework='bootstrap3')
        files = {'files': clean_files(list(files))}

        return render(files, 'files/index.html', ctx={'data': files, 'pagination': pagination})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号