+class BookPreviewSerializer(BookDetailSerializer):
+ class Meta:
+ model = Book
+ fields = BookDetailSerializer.Meta.fields + ['slug']
+ legacy_non_null_fields = BookDetailSerializer.Meta.legacy_non_null_fields
+
+
+class EbookSerializer(BookListSerializer):
+ txt = EmbargoURLField(source='txt_url')
+ fb2 = EmbargoURLField(source='fb2_url')
+ epub = EmbargoURLField(source='epub_url')
+ mobi = EmbargoURLField(source='mobi_url')
+ pdf = EmbargoURLField(source='pdf_url')
+
+ class Meta:
+ model = Book
+ fields = ['author', 'href', 'title', 'cover', 'slug'] + Book.ebook_formats
+ legacy_non_null_fields = ['author', 'cover'] + Book.ebook_formats
+
+