from rest_framework import serializers class PermissionAllUserSerializer(serializers.Serializer): user = serializers.UUIDField(read_only=True, source='id') user_display = serializers.SerializerMethodField() class Meta: only_fields = ['id', 'username', 'name'] @staticmethod def get_user_display(obj): return str(obj)