Q:

Django DRF Serializer: ManyToMany on different PK

I have a many to many field:
guests = models.ManyToManyField(User, blank=True)

How can a create a custom serializer field for this many to many field?
A requirement is the source must be from the username instead of the id field. 
Similar implementation for a single field is:
user_username = serializers.CharField(source='user.username') 

A:

Solution I found:
guests = serializers.SlugRelatedField(
        queryset=User.objects.all(), many=True, slug_field="username", required=False
    )

