当前位置: 首页>>代码示例>>Python>>正文


Python Book.book_list方法代码示例

本文整理汇总了Python中catalogue.models.Book.book_list方法的典型用法代码示例。如果您正苦于以下问题:Python Book.book_list方法的具体用法?Python Book.book_list怎么用?Python Book.book_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在catalogue.models.Book的用法示例。


在下文中一共展示了Book.book_list方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: catalogue_csv

# 需要导入模块: from catalogue.models import Book [as 别名]
# 或者: from catalogue.models.Book import book_list [as 别名]
def catalogue_csv(path):
    books_by_author, orphans, books_by_parent = Book.book_list()
    render_to_csv(path, 'reporting/catalogue.csv', {
        'books_by_author': books_by_author,
        'orphans': orphans,
        'books_by_parent': books_by_parent,
    })
开发者ID:fnp,项目名称:wolnelektury,代码行数:9,代码来源:views.py

示例2: catalogue_pdf

# 需要导入模块: from catalogue.models import Book [as 别名]
# 或者: from catalogue.models.Book import book_list [as 别名]
def catalogue_pdf(path):
    books_by_author, orphans, books_by_parent = Book.book_list()
    render_to_pdf(
        path,
        "reporting/catalogue.texml",
        locals(),
        {"wl-logo.png": os.path.join(settings.STATIC_ROOT, "img/logo-big.png")},
    )
开发者ID:prmtl,项目名称:wolnelektury,代码行数:10,代码来源:views.py

示例3: catalogue_pdf

# 需要导入模块: from catalogue.models import Book [as 别名]
# 或者: from catalogue.models.Book import book_list [as 别名]
def catalogue_pdf(path):
    books_by_author, orphans, books_by_parent = Book.book_list()
    render_to_pdf(path, 'reporting/catalogue.texml', {
        'books_by_author': books_by_author,
        'orphans': orphans,
        'books_by_parent': books_by_parent,
    }, {
        "wl-logo.png": os.path.join(settings.STATIC_ROOT, "img/logo-big.png"),
    })
开发者ID:fnp,项目名称:wolnelektury,代码行数:11,代码来源:views.py

示例4: book_list

# 需要导入模块: from catalogue.models import Book [as 别名]
# 或者: from catalogue.models.Book import book_list [as 别名]
def book_list(request, filters=None, template_name='catalogue/book_list.html',
              nav_template_name='catalogue/snippets/book_list_nav.html',
              list_template_name='catalogue/snippets/book_list.html'):
    """ generates a listing of all books, optionally filtered """
    books_by_author, orphans, books_by_parent = Book.book_list(filters)
    books_nav = OrderedDict()
    for tag in books_by_author:
        if books_by_author[tag]:
            books_nav.setdefault(tag.sort_key[0], []).append(tag)
    return render(request, template_name, {
        'rendered_nav': render_to_string(nav_template_name, {'books_nav': books_nav}),
        'rendered_book_list': render_to_string(list_template_name, {
            'books_by_author': books_by_author,
            'orphans': orphans,
            'books_by_parent': books_by_parent,
        })
    })
开发者ID:fnp,项目名称:wolnelektury,代码行数:19,代码来源:views.py

示例5: catalogue_csv

# 需要导入模块: from catalogue.models import Book [as 别名]
# 或者: from catalogue.models.Book import book_list [as 别名]
def catalogue_csv(path):
    books_by_author, orphans, books_by_parent = Book.book_list()
    render_to_csv(path, 'reporting/catalogue.csv', locals())
开发者ID:jumasheff,项目名称:wolnelektury,代码行数:5,代码来源:views.py


注:本文中的catalogue.models.Book.book_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。