X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/7fac6e7f9c46a423bb3581856c42c8c7ded7d3cf..94b69cb76f0bdc6fe119a9acc84f73d3afc82cf2:/src/catalogue/api/serializers.py?ds=sidebyside diff --git a/src/catalogue/api/serializers.py b/src/catalogue/api/serializers.py index 45252a8f0..06832e794 100644 --- a/src/catalogue/api/serializers.py +++ b/src/catalogue/api/serializers.py @@ -147,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):