X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/099458fdc499ac939a42af27c0df30afcdff55e9..02fb0f76b6b1e69383b8fc61d3aa819d6598f9f8:/src/catalogue/models/book.py diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 81f3b79f8..60ef5d53c 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -45,6 +45,7 @@ _cover_upload_to = UploadToPath('book/cover/%s.jpg') _cover_thumb_upload_to = UploadToPath('book/cover_thumb/%s.jpg') _cover_api_thumb_upload_to = UploadToPath('book/cover_api_thumb/%s.jpg') _simple_cover_upload_to = UploadToPath('book/cover_simple/%s.jpg') +_cover_ebookpoint_upload_to = UploadToPath('book/cover_ebookpoint/%s.jpg') def _ebook_upload_to(upload_path): @@ -98,6 +99,11 @@ class Book(models.Model): null=True, blank=True, upload_to=_simple_cover_upload_to, max_length=255) + cover_ebookpoint = EbookField( + 'cover_ebookpoint', _('cover for Ebookpoint'), + null=True, blank=True, + upload_to=_cover_ebookpoint_upload_to, + max_length=255) ebook_formats = constants.EBOOK_FORMATS formats = ebook_formats + ['html', 'xml'] @@ -173,7 +179,7 @@ class Book(models.Model): return self.tag_unicode('genre') def translators(self): - translators = self.get_extra_info_json().get('translators') + translators = self.get_extra_info_json().get('translators') or [] return [ '\xa0'.join(reversed(translator.split(', ', 1))) for translator in translators ] @@ -556,6 +562,7 @@ class Book(models.Model): book.cover_thumb.build_delay() book.cover_api_thumb.build_delay() book.simple_cover.build_delay() + book.cover_ebookpoint.build_delay() # Build HTML and ebooks. book.html_file.build_delay()