from rest_framework import serializers

from sigma_core.models.cluster import Cluster
from sigma_core.serializers.group import GroupSerializer

class BasicClusterSerializer(serializers.ModelSerializer):
    """
    Serialize Cluster model without memberships.
    """
    class Meta:
        model = Cluster
        exclude = ('resp_group',
            'req_rank_invite',
            'req_rank_kick',
            'req_rank_accept_join_requests',
            'req_rank_promote',
            'req_rank_demote',
            'req_rank_modify_group_infos',
            'default_member_rank',
            'protected',
            'private')


from sigma_core.serializers.user import UserWithPermsSerializer
class ClusterSerializer(BasicClusterSerializer):
    """
    Serialize Cluster model with memberships.
    """
    class Meta(BasicClusterSerializer.Meta):
        pass

    users = UserWithPermsSerializer(read_only=True, many=True)

@@ -634,72 +634,8 @@
 )%0A%0A%0A
-from sigma_core.serializers.user import UserWithPermsSerializer%0A
 clas
@@ -813,34 +813,49 @@
 sers
+_ids
  = 
-U
 ser
-WithPermsSerializer
+ializers.PrimaryKeyRelatedField
 (rea
@@ -876,10 +876,26 @@
 any=True
+, source='users'
 )%0A

Use only foreign keys in Cluster serialisation and add _id suffixes