X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/099458fdc499ac939a42af27c0df30afcdff55e9..30ceb98e6272767f8f271ecb0de30858e1c1a88e:/src/catalogue/api/serializers.py?ds=sidebyside diff --git a/src/catalogue/api/serializers.py b/src/catalogue/api/serializers.py index d52959b92..06832e794 100644 --- a/src/catalogue/api/serializers.py +++ b/src/catalogue/api/serializers.py @@ -106,11 +106,12 @@ class BookDetailSerializer(LegacyMixin, serializers.ModelSerializer): 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'] @@ -146,12 +147,13 @@ class CollectionListSerializer(serializers.ModelSerializer): 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):