1
0
mirror of https://github.com/etesync/server synced 2024-12-27 09:48:24 +00:00

Browsable API: use input fields for relations.

This commit is contained in:
Tom Hacohen 2020-09-13 14:13:06 +03:00
parent c04650f890
commit 3de1d48b9e

View File

@ -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)