I\'d like to be able to create a UUID
on the client and send it to Django Rest Framework (DRF) and use that for the Primary Key
of the Mod
The id
field of the serializer is set as read-only because of the editable=False
argument.
Model fields which have editable=False set, and AutoField fields will be set to read-only by default,
Try declaring it explicitly:
class PersonCreateSerializer(serializers.ModelSerializer):
# Explicit declaration sets the field to be `read_only=False`
id = serializers.UUIDField()
class Meta:
model = Person
fields = ('id', 'username', 'email', 'password')