class CollectionMetadataSerializer(serializers.ModelSerializer): """ A serializer for a CollectionVersion metadata. """ tags = relations.ManyRelatedField(relations.StringRelatedField()) class Meta: model = models.CollectionVersion fields = ( "authors", "contents", "dependencies", "description", "documentation", "homepage", "issues", "license", "repository", "tags", )
class HandSerializer(serializers.ModelSerializer): player = relations.StringRelatedField(many=False) class Meta: model = Hand fields = ('id', 'score', 'player')
class RoomSerializer(serializers.ModelSerializer): members = relations.StringRelatedField(many=True) class Meta: model = Room fields = ('id', 'name', 'members')