X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/7fac6e7f9c46a423bb3581856c42c8c7ded7d3cf..174cf7969627acdc1642f2eda012499b218abac8:/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):