From 3de1d48b9ed43619c94e15d9f8b451e0d2e151b4 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 13 Sep 2020 14:13:06 +0300 Subject: [PATCH] Browsable API: use input fields for relations. --- django_etebase/serializers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django_etebase/serializers.py b/django_etebase/serializers.py index 35b3562..b683580 100644 --- a/django_etebase/serializers.py +++ b/django_etebase/serializers.py @@ -187,6 +187,7 @@ class CollectionItemRevisionSerializer(BetterErrorsMixin, serializers.ModelSeria chunks = ChunksField( source='chunks_relation', queryset=models.RevisionChunkRelation.objects.all(), + style={'base_template': 'input.html'}, many=True ) meta = BinaryBase64Field() @@ -317,6 +318,7 @@ class CollectionMemberSerializer(BetterErrorsMixin, serializers.ModelSerializer) username = UserSlugRelatedField( source='user', read_only=True, + style={'base_template': 'input.html'}, ) class Meta: @@ -341,7 +343,8 @@ class CollectionMemberSerializer(BetterErrorsMixin, serializers.ModelSerializer) class CollectionInvitationSerializer(BetterErrorsMixin, serializers.ModelSerializer): username = UserSlugRelatedField( source='user', - queryset=User.objects + queryset=User.objects, + style={'base_template': 'input.html'}, ) collection = serializers.CharField(source='collection.uid') fromPubkey = BinaryBase64Field(source='fromMember.user.userinfo.pubkey', read_only=True)