本文整理汇总了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,
})
示例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")},
)
示例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"),
})
示例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,
})
})
示例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())