本文整理匯總了Python中book.Book.pages方法的典型用法代碼示例。如果您正苦於以下問題:Python Book.pages方法的具體用法?Python Book.pages怎麽用?Python Book.pages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類book.Book
的用法示例。
在下文中一共展示了Book.pages方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _get_book_from_json_dict
# 需要導入模塊: from book import Book [as 別名]
# 或者: from book.Book import pages [as 別名]
def _get_book_from_json_dict(self, data):
"""
Create a new Book instance based on a JSON dict.
@param data: a JSON dictionary
@return: a new Book instance (sans ISBN)
"""
publishers = ', '.join([self._get_publisher_from_json_dict(p) for p in data['publishers']])
authors = ', '.join([self._get_author_from_json_dict(a) for a in data['authors']])
book = Book(0) # better to create an object, even if there's no valid barcode yet
book.title = data.get('title', None)
book.publisher = publishers
book.authors = authors
book.pages = data.get('number_of_pages', None) # might cause issue, be careful.
book.publ_year = data.get('publish_date', None)
book.description = data.get('excerpts', None)
return book