class Meta:
model = Book
fields = [
- 'title', 'url',
+ 'title', 'url', 'language',
'epochs', 'genres', 'kinds', 'authors', 'translators',
'fragment_data', 'children', 'parent', 'preview',
'epub', 'mobi', 'pdf', 'html', 'txt', 'fb2', 'xml', 'media', 'audio_length',
- 'cover_color', 'simple_cover', 'cover_thumb', 'cover', 'simple_thumb'
+ 'cover_color', 'simple_cover', 'cover_thumb', 'cover', 'simple_thumb',
+ 'isbn_pdf', 'isbn_epub', 'isbn_mobi',
]
legacy_non_null_fields = ['html', 'txt', 'fb2', 'epub', 'mobi', 'pdf',
'cover', 'simple_cover', 'cover_thumb', 'simple_thumb']
class CollectionSerializer(serializers.ModelSerializer):
- books = BookSerializer(many=True, source='get_books')
+ books = BookSerializer(many=True, source='get_books', read_only=True)
+ book_slugs = serializers.CharField(write_only=True)
url = AbsoluteURLField()
class Meta:
model = Collection
- fields = ['url', 'books', 'description', 'title']
+ fields = ['url', 'books', 'description', 'title', 'book_slugs']
class FragmentSerializer(serializers.ModelSerializer):